I export the radgridview to pdf with header and footer. How to have multiple lines of header with different font size?
Telerik.WinControls.Export.GridViewPdfExport exporter = new Telerik.WinControls.Export.GridViewPdfExport(this.radGridView1);
3 Answers, 1 is accepted
GridViewPdfExport has a public API for applying a certain font for the header. You can specify left, right or middle header. Multiline header text with different fonts is not supported out of the box. However, it is possible to customize the default rendering of the header. For this purpose it is necessary to create a GridViewPdfExport and override its DrawHeader method. Note that GridViewPdfExport utilizes the powerful RadPdfProcessing library and exports RadGridView`s data natively to the PDF format. Additional information about the library and the API it offers is available in the online documentation: https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/overview
Here is the sample code snippet for showing two line header with different font:
Note that this is just a sample approach and it may not cover all possible cases. Feel free to modify it in a way which suits your requirement best.
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Extremely helpful examples.
I want to push the grid table to lower position so I have more room for header. If I use the GridViewPdfExport without customize, the grid table with Header is lower than the one customize with Header.
How can I push the grid table down?
You can push the grid down inside the exported document, by increasing the HeaderHeight property of the GridViewPdfExport object. For example, you can test like this:
I hope this will help. Let me know if you need further assistance.