Skip to main content

XRPageInfo.TextFormatString Property

Specifies the output format for content of the XRPageInfo control.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.2.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

[Browsable(true)]
public override string TextFormatString { get; set; }

Property Value

Type Description
String

The output format for content of the XRPageInfo control.

Remarks

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.

Example

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}
        }
    }
};

Tip

Use the Document.PrintingSystem.Culture property to display the date and time in a culture different from the report’s culture.

See Also