Table CellSpacing - Export to PDF

2 posts, 0 answers
  1. Justin Lee
    Justin Lee avatar
    146 posts
    Member since:
    Dec 2009

    Posted 20 Jul 2012 Link to this post

    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.

    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)

  2. Kammen
    Kammen avatar
    312 posts

    Posted 25 Jul 2012 Link to this post

    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.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft R3 2016 release webinar banner
Back to Top