'Declaration <DescriptionAttribute("A string used to dynamically create the header or footer element's text. Use DATETIME to print current date, PAGE to print page number and TOTALPAGES to print the total number of pages.")> <CategoryAttribute("Appearance")> <LocalizableAttribute(True)> <DefaultValueAttribute("")> <EndUserDisplayNameAttribute("Text")> Public Property TextFormat As String
'Usage Dim instance As HeaderFooterElement Dim value As String instance.TextFormat = value value = instance.TextFormat
[Description("A string used to dynamically create the header or footer element's text. Use DATETIME to print current date, PAGE to print page number and TOTALPAGES to print the total number of pages.")] [Category("Appearance")] [Localizable(true)] [DefaultValue("")] [EndUserDisplayName("Text")] public string TextFormat {get; set;}
Property Value
A string used to dynamically create the HeaderFooterElement's text. By default, "".
The following table provides a list of the supported variables and their definitions.
Supported variables | Descriptions |
---|---|
%PAGE[ format=["]format_specifier["] ]% | The current page. |
%TOTALPAGES[ format=format_specifier]% | The total number of pages. |
%DATETIME[ format=["]format_specifier["] ]% | The current date and time. By default, the system short date pattern will be used. |
%TITLE[ format=["]format_specifier["] ]% | The title of the report. |
All items placed in square brackets [] are optional. If the format_specifier contains spaces, then quotes must be used.
In addition to the default variables, custom variables can be provided through the ReportSettings.CustomVariables property. The string representation of the default variables as well as the custom ones can be modified during the QueryVariableText event.
Dim report As New Report( GridControl1 )
report.ReportStyleSheet.PageHeader.LeftElement.TextFormat = "The current date is: %DATETIME format=""dd MMM yy""%"
report.PrintPreview()
Report report = new Report( gridControl1 );
report.ReportStyleSheet.PageHeader.LeftElement.TextFormat = "The current date is: %DATETIME format=\"dd MMM yy\"%";
report.PrintPreview();