We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set header and footer in the PDF/Excel/Word exported page?

You can set the header and footer in PDF, Excel, and Word exported documents by using the following events:

  • ExportPDF for PDF.
  • ExportExcel for Excel.
  • ExportWord for Word.

 

In the ExportPDF event, properties are written under the PDFExportSettings class. To display header and footer in the exported document, the properties ShowPDFHeader and ShowPDFFooter should be set to true. The header and footer text can be set by using the PDFHeaderText and PDFFooterText properties, respectively. In addition to this, PDFHeaderDescription property helps you to set the description of the header.

 

In the ExportExcel event, properties are written under the PageSetup class. The properties, CenterHeader and CenterFooter allow you to set the header and footer in the middle of a page. Likewise, the properties, LeftHeader, LeftFooter, RightHeader, and RightFooter allow the user to set the header and footer in the left or right side of a page.

 

Note: Header and footer are not displayed in an Excel sheet, by default. You can enable the header and footer under the Insert tab to show them page wise and also while printing.

 

In the ExportWord event, properties are written under the WordExportSettings class. To display header and footer in the exported document, the properties ShowHeader and ShowFooter should be set to true. The header and footer text can be set by using the HeaderText and FooterText properties, respectively.

 

The following code example illustrates how to add header and footer in the PDF, Excel, and Word exported document.

C#

 

VB

 

Article ID: Published Date: Last Revised Date: Platform: Control:
5214 07/16/2015 07/16/2015 ASP.NET Web Forms (Classic) OlapGrid
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon