Xceed Grid for WinForms v4.3 Documentation
Using variables in page headers and footers
Welcome to Xceed Grid for WinForms v4.3 > Basic Concepts > Reporting > Using variables in page headers and footers

Xceed Grid for WinForms provides built-in variables that can be used in the page header and footer of your reports. In addition, it is possible to define your own variables using the CustomVariables property of the ReportSettings class. See The ReportSettings class for more details. The four built-in variables are as follows:

  • %TOTALPAGES%

  • %DATETIME%

  • %PAGE%

  • %TITLE%

It is strongly recommended that developers avoid using the %TOTALPAGES% variable when dealing with a large report. When the %TOTALPAGES% variable is used, the total number of pages is calculated before printing, exporting or previewing starts. With large reports, this can introduce considerable overhead.

Using the variables

The variables can be used in the Customize Report Style form. To do this, choose Page Header or Page Footer and the section (left, center or right), in the Report Elements section. Then in the Report Element Properties section, insert the variable you wish to use into the TextFormat property. In the image below, /%totalpages% has been used in the Text property of the right section of the report's page footer. Note that these variables are case-insensitive.