The column's format for formulas.
Usage
Set_Property(OLECtrlEntID, "OLE.ColumnFormulaFormat[col]", StringValue)
Values
StringValue can be any string meeting the format requirements explained in below.
Syntax: Depends on the column type. See Remarks for details.
Default: ""
Indices
Index | Description |
---|---|
col | The index to a column in the report table |
Remarks
The ColumnFormulaFormat property determines how the column's formula results are displayed. Formulas are added to a column using the ColumnFormula property. Only columns of type Number support formulas, so only number formatting is explained here. For a complete list of of column types, see ColumnList. For formatting other column types, see ColumnFormat.
Number Formatting
Numbers are stored as floating point values within the Report Table. Thus, if your data contains decimal values, make sure you include the decimal when you load the Report Table. In other words, there is no equivalent MD2 format for the Report Table. Instead, the Report Table uses an Excel-like syntax to format and round off decimal numbers.
You can use any characters in the Format field, but '#', '0', commas, and periods are reserved characters. Any other character is treated as a literal and is displayed as is. Thus, you may use literal characters in your format to prefix or suffix the data as you choose. If you need to use any reserved characters literally, then surround your literal text in single or double quotes. If you need to display quotes, place two of them side by side. The reserved characters are interpreted as follows:
Character | Displays |
---|---|
# | Significant Digits Only |
0 | Significant Digits or Insignificant Zeros |
comma | 1. If within the number, then commas separate every three digits |
2. If trailing the number, then the number is shown as an integer divided by 1000 for each trailing comma | |
period | Decimal point. The first decimal denotes the beginning of the fractional portion of the number. All subsequent decimals are treated as literals |
Here are some example number formats:
To Display | As | Use |
---|---|---|
1234.59 | 1234.6 | ####.# |
8.9 | 8.900 | #.000 |
.631 | 0.6 | 0.# |
44.398 | $44.40 | $0.00 |
1234.568 | $1,234.57 | $#,##0.00 |
5.25 | 5.25% | 0.00% |
12000 | 12,000 | #,### |
12000 | 12 | #, |
12200000 | 12.2 | 0.0,, |
Example
// Format the subtotals as currency Set_Property(@Window:".OLE_REPORTTABLE", "OLE.ColumnFormulaFormat[2]", "$#,##0.00") // Format the subtotals with some literal text Set_Property(@Window:".OLE_REPORTTABLE", "OLE.ColumnFormulaFormat[2]", "Total Amt: $#,##0.00")