Xceed Grid for WinForms v4.3 Documentation
CustomVariables Property


Xceed.Grid.v4.3 Assembly > Xceed.Grid.Reporting Namespace > ReportSettings Class : CustomVariables Property
Gets a dictionary of case-insensitive custom variables.
Syntax
'Declaration
 
Public ReadOnly Property CustomVariables As StringDictionary
'Usage
 
Dim instance As ReportSettings
Dim value As StringDictionary
 
value = instance.CustomVariables
public StringDictionary CustomVariables {get;}

Property Value

A System.Collections.Specialized.StringDictionary containing the custom variables.
Remarks

The following table provides a list of the supported default 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 CustomVariables property. The string representation of the default variables as well as the custom ones can be modified during the Report.QueryVariableText event.

The following example demonstrates how to set the TextFormat property to display the current date.

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();
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ReportSettings Class
ReportSettings Members