XRPageInfo Class
A Page Information control that is used to display auxiliary information on report pages.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v20.1.dll
NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.Reporting.Core
Declaration
Remarks
General Information
XRPageInfo displays auxiliary information on report pages:
- date and time
- page numbers
- user name
To add the XRPageInfo control to a report, drag the XRPageInfo item from the DX:20.1: Report Controls Toolbox tab and drop it on the report band.
The XRPageInfo.PageInfo property specifies the kind of information the control displays: page numbers, system date-time, and user name.
Features
For usage examples, review the following tutorials:
Note
This control cannot be bound to a data source’s field. To display non-static information, use the XRLabel or XRRichText controls.
Use a combination of the XRPageInfo.PageInfo and XRPageInfo.TextFormatString properties to specify how the control displays information. Set the PageInfo property to PageInfo.NumberOfTotal and the TextFormatString the Page {0} of {1} string to display page count:
Tip
If a report contains at least one group, you can specify individual page numbers for report groups. Set the XRPageInfo.RunningBand property to the name of the group whose page numbers should be displayed.
Localization
To localize the date and time strings that the control displays, specify the PrintingSystemBase.Culture property. When a document is created, the property is set to the value of the current thread’s culture to ensure consistency with other culture-sensitive formatting. Subsequently you can change it to display day and time values in another language.
You can localize a report and set the XRPageInfo.TextFormatString property to different values for different languages. Thi method allows you to translate format strings such as Page {0} of {1} to the report’s language.
Example
The following code snippet demonstrates how to create an XRPageInfo object, and set its properties.
using System.Drawing;
using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
// ...
public XRPageInfo CreateXRPageInfo() {
XRPageInfo pageInfo1 = new XRPageInfo
{
SizeF = new SizeF(200F, 50F),
BackColor = Color.PaleGreen,
PageInfo = PageInfo.DateTime,
Format = "{0:MM/dd/yyyy}",
StartPageNumber = 2
};
return pageInfo1;
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the XRPageInfo class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.