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

Having trouble adding table to PDF when exporting

2 Answers 122 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin Bauer
Top achievements
Rank 1
Kevin Bauer asked on 16 Apr 2012, 05:46 PM
I'm currently using the RadGrid's "Export to PDF" functionality to generate a report that is printed and signed by the different department heads in our organization. I'd like to add a header to the first page of the printed report that has the company logo and spaces for the department heads to sign.

I've tried following the suggestion in this thread:
http://www.telerik.com/community/forums/aspnet-ajax/grid/export-rad-grid-to-excel-pdf-and-ms-word-with-headers.aspx 

Using the test code provided works fine, but when I attempt to add a table to e.RawHTML my additions are not rendered.

I use the following PDFExporting method:

protected void rgReport_PDFExporting(object sender, GridPdfExportingArgs e)
{
    e.RawHTML = "<table><tr><td>Test</td></tr></table>" + e.RawHTML;
}

The outputted pdf has the contents of the radgrid, but the table with the word "test" in it, which should appear at the top of the document, is not there.

I imagine the problem has to do with the PDF export requiring valid XHTML, but from what I can see my markup should be valid. Can someone let me know what I'm missing here?

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 17 Apr 2012, 02:58 PM
Hi Kevin,

Please examine the Exporting HTML tables section in the following topic:
RadGrid PDF Export

I hope this helps.

Best regards,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Kevin Bauer
Top achievements
Rank 1
answered on 17 Apr 2012, 03:31 PM
That did the trick. The problem was that I didn't have the <colgroup> tags.
Tags
Grid
Asked by
Kevin Bauer
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Kevin Bauer
Top achievements
Rank 1
Share this question
or