The column's formula.

Usage

Set_Property(OLECtrlEntID, "OLE.ColumnFormula[col]", FormulaOption)

Values

FormulaOption can be any of the formula options listed below.

Default: ""

Indices

IndexDescription
colThe index to a column in the report table

Remarks

The ColumnFormula property can be used to add subtotals, averages, etc. to your table. You can only apply a formula to a Number type column. You can set this property to one of the following values:

SUMAVGMIN, or MAX.

The formula you choose will be applied across grouped rows which will appear within the group rows themselves. For example, if you choose SUM, then you will get subtotals appearing within each group row. This means that the subtotal will appear above the rows from which it was calculated. Using the same example, If you have the table footer visible, then it will display a grand total.

The format for the formula results will be the same as the entire column, but if you wish to format the formula results separately, you can use the ColumnFormulaFormat property.

Example

// Calculate sub totals and totals in column 4
Set_Property(@Window:".OLE_REPORTTABLE", "OLE.ColumnFormula[4]", "SUM")

// Calculate averages dollar amounts in column 2 and format it
Set_Property(@Window:".OLE_REPORTTABLE", "OLE.ColumnFormula[2]", "AVG")
Set_Property(@Window:".OLE_REPORTTABLE", "OLE.ColumnFormulaFormat[2]", "Average: $#,##0.00")

See Also

ColumnFormulaFormat

  • No labels