This is a migrated thread and some comments may be shown as answers.

Table CellSpacing - Export to PDF

1 Answer 60 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Justin Lee
Top achievements
Rank 1
Justin Lee asked on 20 Jul 2012, 05:36 PM
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)

1 Answer, 1 is accepted

Sort by
0
Kammen
Telerik team
answered on 25 Jul 2012, 09:52 AM
Hi Justin,

Indeed, there is a bug when exporting table with cell spacing to PDF. We will do our best to fix it for the next LIB (Latest Internal Build). Unfortunately, the fix will not be included in the service pack, which is expected any day now.

Your Telerik points have been updated in appreciation of your involvement.


Greetings,
Kammen
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
RichTextBox
Asked by
Justin Lee
Top achievements
Rank 1
Answers by
Kammen
Telerik team
Share this question
or