The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I have a GridControl on my form that implements a virtual grid. I have added printing capabilities to it (print, print preview, page header, and page footer) and everything works great, except ...
I need to have a header section: one or more special pages that appear before the grid but as part of the same document. How do I do this?
Bonus question: How do I 'print' all this to a PDF document? (I have the full Enterprise Edition of ESS which includes Essential PDF.)
JJJisha Joy Syncfusion Team December 1, 2009 06:27 AM UTC
Hi,
Thank you for posting query to us.
You need use the derived class GridPrintDocumentAdv for this purpose. Headers and footers can be added with the events called DrawGridPrintHeader and DrawGridPrintFooter. See the following browser sample for more details:
C:\Documents and Settings\[Username]\My Documents\syncfusion\essentialstudio\7.4.0.20\Windows\Grid.Windows\Samples\2.0\Print\Print Grid Demo\cs
Regarding PDF export issue, please refer the following sample that implements the same.
C:\Documents and Settings\[Username]\My Documents\syncfusion\essentialstudio\7.4.0.20\Windows\Grid.Windows\Samples\2.0\Export\PDF Export Demo\cs
Please let me know if you have any queries.
Regards, Jisha
PTPeter TrevorDecember 1, 2009 06:53 PM UTC
Hi Jisha
Thanks for the PDF part, that looks easy enough.
But for the main question ...
I already am using the GridPrintDocumentAdv with headers and footers as that example showed. I can print the grid with page headers and page footers okay. My problem is how do I add extra pages to the output, extra pages that are nothing to do with the grid but I'd like to be sent to the printer (or print preview) as part of the same print job. In other words I want to embed the grid print as part of a larger document.
JJJisha Joy Syncfusion Team December 2, 2009 11:02 AM UTC
Hi,
I think you can do what you want by deriving GridPrintDocument and overriding OnPrintPage and print the the larger document at the begining. Please try this suggestion and let me know if this helps.