This question is locked. New answers and comments are not allowed.
I'm dynamically generating a RadDocument in code, and then displaying it in a RichTextBox. I also have a button to export the document to Word or PDF.
The document displays correctly in the RichTextBox, and exports successfully to Word. However, it throws an error when exporting to PDF. I eventually figured out what caused it: I set the CellSpacing of a Table to 10. If I don't set the cellspacing, the export to PDF works, but I need there to be cell spacing.
I'm using 2012.1. Please help.
Justin
Here is the error it throws when exporting to PDF (if CellSpacing is set):
Object reference not set to an instance of an object.
at Telerik.Windows.Documents.Model.TableBorderGrid.GetLeftVerticalBorder(Int32 rowIndex, Int32 columnIndex)
at Telerik.Windows.Documents.FormatProviders.Pdf.PdfTableBorderExporter.ExportBordersForTable(TableLayoutBox tableBox)
at Telerik.Windows.Documents.FormatProviders.Pdf.PdfTableBorderExporter.ExportBorders()
at Telerik.Windows.Documents.FormatProviders.Pdf.PdfDocumentExporter.ExportSectionLayoutBox(SectionLayoutBox sectionBox, PdfContentsWriter writer)
at Telerik.Windows.Documents.FormatProviders.Pdf.PdfDocumentExporter.ExportPage(SectionLayoutBox sectionBox, PdfContentsWriter writer)
at Telerik.Windows.Documents.FormatProviders.Pdf.PdfDocumentExporter.<>c__DisplayClass3.<Export>b__2(PdfContentsWriter contentsWriter)
at Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfContents.WriteContents(PdfWriter writer)
at Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfStream.WriteToCore(PdfWriter writer)
at Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfObject.WriteTo(PdfWriter writer)
at Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfWriter.WritePdfObject(PdfObject obj)
at Telerik.Windows.Documents.FormatProviders.Pdf.PdfDocumentExporter.Export()
at Telerik.Windows.Documents.FormatProviders.Pdf.PdfFormatProvider.Export(RadDocument document, Stream output)
The document displays correctly in the RichTextBox, and exports successfully to Word. However, it throws an error when exporting to PDF. I eventually figured out what caused it: I set the CellSpacing of a Table to 10. If I don't set the cellspacing, the export to PDF works, but I need there to be cell spacing.
I'm using 2012.1. Please help.
Justin
Here is the error it throws when exporting to PDF (if CellSpacing is set):
Object reference not set to an instance of an object.
at Telerik.Windows.Documents.Model.TableBorderGrid.GetLeftVerticalBorder(Int32 rowIndex, Int32 columnIndex)
at Telerik.Windows.Documents.FormatProviders.Pdf.PdfTableBorderExporter.ExportBordersForTable(TableLayoutBox tableBox)
at Telerik.Windows.Documents.FormatProviders.Pdf.PdfTableBorderExporter.ExportBorders()
at Telerik.Windows.Documents.FormatProviders.Pdf.PdfDocumentExporter.ExportSectionLayoutBox(SectionLayoutBox sectionBox, PdfContentsWriter writer)
at Telerik.Windows.Documents.FormatProviders.Pdf.PdfDocumentExporter.ExportPage(SectionLayoutBox sectionBox, PdfContentsWriter writer)
at Telerik.Windows.Documents.FormatProviders.Pdf.PdfDocumentExporter.<>c__DisplayClass3.<Export>b__2(PdfContentsWriter contentsWriter)
at Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfContents.WriteContents(PdfWriter writer)
at Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfStream.WriteToCore(PdfWriter writer)
at Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfObject.WriteTo(PdfWriter writer)
at Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfWriter.WritePdfObject(PdfObject obj)
at Telerik.Windows.Documents.FormatProviders.Pdf.PdfDocumentExporter.Export()
at Telerik.Windows.Documents.FormatProviders.Pdf.PdfFormatProvider.Export(RadDocument document, Stream output)