John Cooney
Top achievements
Rank 1
John Cooney
asked on 13 Jan 2010, 02:29 AM
I've used the export to PDF from a simple grid and it works great.
My question pertains to using Export to PDF from a hierarchical grid with some additional complications. I have a page (see attachment) which has not only a hierarchical grid but a summary section that sums data from the grid. I'd like to throw all that info to a PDF.
Does the Grid based Export to PDF allow one to modify the contents of the output file by adding additional information such as I have here in my summary section? I can't find any decent example in the help files.
If this is not a feasible solution, what would one do to build a PDF "report" in the middle of this page containing this grid plus summary information?
Thanks much,
JC
My question pertains to using Export to PDF from a hierarchical grid with some additional complications. I have a page (see attachment) which has not only a hierarchical grid but a summary section that sums data from the grid. I'd like to throw all that info to a PDF.
Does the Grid based Export to PDF allow one to modify the contents of the output file by adding additional information such as I have here in my summary section? I can't find any decent example in the help files.
If this is not a feasible solution, what would one do to build a PDF "report" in the middle of this page containing this grid plus summary information?
Thanks much,
JC
6 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 13 Jan 2010, 07:13 AM
Hello John,
You could make use of CommandItemTemplate/FooterTemplate of the grid for this purpose . Include the additional details, like summary in your case, as a part of the grid's content in the Template and set ExportSettings -> ExportOnlyData = false in the export button's click event.
Here's a help article that you can refer to which explains more about this. Go through the portion titled 'Including additional information as part of the exported document'.
Exporting tips and tricks
Hope this helps..
Princy.
You could make use of CommandItemTemplate/FooterTemplate of the grid for this purpose . Include the additional details, like summary in your case, as a part of the grid's content in the Template and set ExportSettings -> ExportOnlyData = false in the export button's click event.
Here's a help article that you can refer to which explains more about this. Go through the portion titled 'Including additional information as part of the exported document'.
Exporting tips and tricks
Hope this helps..
Princy.
0
John Cooney
Top achievements
Rank 1
answered on 15 Jan 2010, 12:04 PM
Thank you.
One follow up question.
If I manually write the data out into an HTML page, is there some way to call the function that will put this HTML page into a PDF?
Sort of like just using the second half of your Export to PDF functionality.
Thanks again.
JC
One follow up question.
If I manually write the data out into an HTML page, is there some way to call the function that will put this HTML page into a PDF?
Sort of like just using the second half of your Export to PDF functionality.
Thanks again.
JC
0
Hello John,
It is possible to insert additional HTML code in the output. Please examine the sample code below:
Let me know if you need more information.
Best regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
It is possible to insert additional HTML code in the output. Please examine the sample code below:
protected void RadGrid1_PdfExporting(object source, GridPdfExportingArgs e){ string myFooter = "<table style='width:297mm;'><colgroup><col /><col /></colgroup><tr><td>test1</td><td>test2</td></tr></table>"; e.RawHTML += myFooter;}Let me know if you need more information.
Best regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
John Cooney
Top achievements
Rank 1
answered on 15 Jan 2010, 12:45 PM
Excellent. Thanks.
So does that mean I also could just go
e.RawHTML = empty string
and then
e.RawHTML = <html>whatever I want</html>
and thereby accomplish my original request?
In other words I could entirely eliminate the content generated by the Export to PDF function originally and write whatever I wanted in there and still use the function to save whatever I generated as a PDF??
Thanks again for the help.
So does that mean I also could just go
e.RawHTML = empty string
and then
e.RawHTML = <html>whatever I want</html>
and thereby accomplish my original request?
In other words I could entirely eliminate the content generated by the Export to PDF function originally and write whatever I wanted in there and still use the function to save whatever I generated as a PDF??
Thanks again for the help.
0
Hello John,
Yes, it is possible to replace the whole content although we don't support such scenario officially.
Best regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Yes, it is possible to replace the whole content although we don't support such scenario officially.
Best regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
John Cooney
Top achievements
Rank 1
answered on 15 Jan 2010, 01:05 PM
I understand. Thanks again for the help.
BTW... this has to be the best supported and best documented piece of software I've ever used in my 20 years of programming.
BTW... this has to be the best supported and best documented piece of software I've ever used in my 20 years of programming.