xtrareports-devexpress-dot-xtrareports-dot-ui-dot-xrpageinfo-867db65d.md
Specifies the output format for content of the XRPageInfo control.
Namespace : DevExpress.XtraReports.UI
Assembly : DevExpress.XtraReports.v25.2.dll
NuGet Package : DevExpress.Reporting.Core
[Browsable(true)]
public override string TextFormatString { get; set; }
<Browsable(True)>
Public Overrides Property TextFormatString As String
| Type | Description |
|---|---|
| String |
The output format for content of the XRPageInfo control.
|
The TextFormatString property allows you to specify an output format for data stored in the XRPageInfo‘s PageInfo property.
Note
Ensure the specified format string fits the type of the data. For instance, in the code example below the expression {0:MMMM d, yyyy} expects the PageInfo property to be a DateTime. This expression does not work for other types, for example for integers. Refer to the following article for more details on formatting: Format types in .NET.
The following code example shows how to display the current date and time, and specify their output format.
Note
Refer to the following help topic for information on how to format data at design time: Format Data.
using DevExpress.XtraReports.UI;
// ...
// Create a XRPageInfo control.
XRPageInfo pageInfo = new XRPageInfo() {
PageInfo = DevExpress.XtraPrinting.PageInfo.DateTime,
WidthF = 250,
// Specify a format string for the control's page info.
TextFormatString = "{0:MMMM d, yyyy}"
};
// Create a report with the page info.
XtraReport report = new XtraReport() {
Bands = {
new DetailBand() {
HeightF = 15,
Controls = {pageInfo}
}
}
};
' Create a XRPageInfo control.
Dim pageInfo As New XRPageInfo() With {
.PageInfo = DevExpress.XtraPrinting.PageInfo.DateTime,
.WidthF = 250,
.TextFormatString = "{0:MMMM d, yyyy}"}
' Create a report with the barcode.
Dim report = New XtraReport()
Dim band = New DetailBand() With {.HeightF = 15}
band.Controls.Add(pageInfo)
' Create a XRPageInfo control.
Tip
Use the Document.PrintingSystem.Culture property to display the date and time in a culture different from the report’s culture.
See Also