'Declaration <DescriptionAttribute("A string used to dynamically create the SummaryRow's text.")> <CategoryAttribute("Appearance")> <LocalizableAttribute(True)> <ApplyToDesignerAttribute(True)> Public Property TextFormat As String
'Usage Dim instance As SummaryRow Dim value As String instance.TextFormat = value value = instance.TextFormat
[Description("A string used to dynamically create the SummaryRow's text.")] [Category("Appearance")] [Localizable(true)] [ApplyToDesigner(true)] public string TextFormat {get; set;}
Property Value
A string used to dynamically create the SummaryRow's Text. By default, DefaultTextFormat.
The following table provides a list of the supported variables and their definitions.
Note: Variables must be preceded and followed by a % symbol. See below for a usage example.
Supported variables | Descriptions |
---|---|
%GROUPBYCOLUMNFIELDNAME% | The Column.FieldName of the column as defined by the parent group's GroupBy property. |
%GROUPBYCOLUMNTITLE% | The Column.Title of the column represented by the parent group's GroupBy property. |
%GROUPKEY% | The Key of the parent group. |
%GROUPTITLE% | The Title of the parent group. |
%DATAROWCOUNT% | The number of datarows in the parent group. |
%COUNT: (see below for usage)% | The result of the Count statistical function. |
%MAX: (see below for usage)% | The result of the Maximum statistical function. |
%MIN: (see below for usage)% | The result of the Minimum statistical function. |
%SUM: (see below for usage)% | The result of the Sum statistical function. |
%AVG: (see below for usage)% | The result of the Average statistical function. |
%STDEV: (see below for usage)% | The result of the Standard Deviation statistical function. |
%STDEVP: (see below for usage)% | The result of the Standard Deviation Population statistical function. |
%VAR: (see below for usage)% | The result of the Variance statistical function. |
%VARP: (see below for usage)% | The result of the Variance Population statistical function. |
%MEDIAN: (see below for usage)% | The result of the Median statistical function. |
%MODE: (see below for usage)% | The result of the Mode statistical function. |
%GEOMEAN: (see below for usage)% | The result of the Geometric Mean statistical function. |
%HARMEAN: (see below for usage)% | The result of the Harmonic Mean statistical function. |
%RMS: (see below for usage)% | The result of the Root Mean Square statistical function. |
In the case of the variables that represent StatFunctions (COUNT, MAX, MIN, SUM, AVG, STDEV, STDEVP, VAR, VARP, MEDIAN, MODE, GEOMEAN, HARMEAN, and RMS), additional parameters must be provided within the variable after the colon (:). These parameters are the fieldname of the column from which the data is retrieved, the (optional) format specifier with which the result of the statistical function is displayed, and the (optional) group level for which the statistical function is calculated.
All items placed in square brackets [] are optional. If the column_fieldname and/or format_specifier parameters contain spaces, quotes must be used. If a running_stat_group_level is not specified, -1 (current group) is assumed. Example 1 below demonstrates how to set the TextFormat property using statistical function variables.
%COUNT: ["]column_fieldname["] [ format=["]format_specifier["] ] [ level=running_stat_group_level ]%
The format of a mathematical function depends on 2 things: the function itself and the datatype of the column whose values are used for the statistical function.
The following table provides a list of supported and unsupported format specifiers relative to the datatype of the column whose values are used for the statistical function.
Statistical function | Column datatype | Datatype sent to the format specifier | Unsupported format specifiers |
---|---|---|---|
COUNT | Any | Int64 | R |
MAX, MIN, MODE | Anything that implements the IComparable interface. | Always the same as the datatype of the column specified by the column_fieldname parameter. | |
SUM | Integral type* | Int64 | R |
Floating point types** | Double | D and X | |
Decimal | Decimal | D, X and R | |
AVG, VAR, VARP, HARMEAN | Integral* and Floating point** types | Double | D and X |
Decimal | Decimal | D, X and R | |
STDEV, STDEVP, GEOMEAN, RMS | Integral*, Floating point**, and Decimal types | Double | D and X |
MEDIAN | Integral type* (even item count) | Double | D and X |
Integral type* (odd item count) | Int64 | R | |
Floating point types** | Double | D and X | |
Decimal | Decimal | D, X and R |
* Integral types : Byte, SByte, Char, Int16, UInt16, Int32, UInt32, Int64, UInt64
** Floating point types: Single and Double
The values are rounded in the same manner as the string.Format round, meaning a banker's round.
Hint: You can use F0 instead of D. It will have the same behavior and will work for either integral types or floating point types. Example 2 below demonstrates how quotes can be used to specify literals in the format_specifier.