GridDataControl allows you to export the Grid to pdf using the following extension methods ExportToPdf, ExportToPdfDocument, ExportToPdfGrid and ExportToPdfGridDocument that are in the namespace Syncfusion.Windows.Controls.Grid.Converter.
You can customize the exporting by using “ExportToPdfDocument” and “ExportToPdf” methods that has ExportToPdfOptions as parameter. ExportToPdfOptions provides various options to customize the exporting as per your requirement.
The list of properties available in ExportToPdfOptions class is as follows
You can refer the following code sample to customize the Pdf Exporting Options.
After getting the file name, you can create a new PdfDocument by exporting the Grid. Here the property ExportStyles is set as ‘False’ so that when you export to pdf, styles are not exported in order to improve the export performance. You can exclude Freight column from export by adding it to ExcludeColumns property. By setting the property RepeatHeaders as ‘False’, you can avoid the repetition of headers at every page in the exported pdf.
You can change the font and style of PDFGrid before drawing to PDFdocument. You can refer the following link for more information to customize PDFGrid.
The following screenshots illustrate the exported Pdf files using ExportToPdfDocument.
When ExportStyles is set as True:
When ExportStyles is set as False:
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:||Product Version:|