Hi Dhirender,
Thanks for using Syncfusion Products.
We have prepared a Grid Exporting sample based on your requirement and the same can be downloaded from below link.
Sample: http://www.syncfusion.com/downloads/support/directtrac/118444/Sample2030582165.zip
In the above sample for pdf exporting, we have added header and footer to the pdf document using “PdfPageTemplateElement”. Please refer the following code snippets.
protected void FlatGrid_ServerPdfExporting(object sender, Syncfusion.JavaScript.Web.GridEventArgs e)
{
...
PdfPageTemplateElement footer = new PdfPageTemplateElement(rect);
PdfPageTemplateElement header = new PdfPageTemplateElement(rect);
...
footer.Graphics.DrawString("Custom Text - Footer", font, brush, rect, format); //Add custom text to the header
header.Graphics.DrawString("Custom Text - Header", font, brush, rect, format); //Add custom text to the footer
pdfdocument.Template.Bottom = footer; //Append custom template to the document
pdfdocument.Template.Top = header;
pdfdocument.Save("Export.pdf", Response, HttpReadType.Save); |
Please refer the following UG document and online sample link for further reference on exporting.
Documentation: http://help.syncfusion.com/ug/js/documents/exporting3.htm
Online Sample: http://asp.syncfusion.com/demos/web/grid/excelexporting.aspx
Regards,
Alan Sangeeth S