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

IndexDescription
colThe 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:

CharacterDisplays
#Significant Digits Only
0Significant Digits or Insignificant Zeros
comma1. 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
periodDecimal 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 DisplayAsUse
1234.591234.6####.#
8.98.900#.000
.6310.60.#
44.398$44.40$0.00
1234.568$1,234.57$#,##0.00
5.255.25%0.00%
1200012,000#,###
1200012#,
1220000012.20.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")

See Also

ColumnListColumnFormatColumnFormula

  • No labels