Hi,
I have a WebHierarchicalDataGrid in page, and I need export its content to a pdf file. When exporting to file, I need add a custom report header in pdf file.
I am using the following codes.
Report report = new Report();
ISection gridSection = report.AddSection();
IText headerText = gridSection.AddText();
headerText.AddContent("Header Content");
headerText.AddLineBreak();
headerText.AddContent("Report Date: " + DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss tt"));
exporter.Export(WebHierarchicalDataGrid1, report);
But the result is the report header in the first page, and the content of WebHierarchicalDataGrid in the next page. In fact, I want the content of WebHierarchicalDataGrid is at the following of header.
How should I do?
Thank you.
Hello jason li,
During export you should point the report section to use for the grid. If a section is not specified, the grid will be placed on a new page. In your case, just edit the last row to include the section:
WebDocumentExporter1.Export(WebHierarchicalDataGrid1, report, gridSection);
If you have any other questions, please let me know.
Thanks, Nikolay. It works fine by your way.
I'm glad I could help.
Let me know if you have any other questions.