Skip to main content

TdxSpreadSheetConditionalFormattingRuleExpression.Expression Property

Specifies a formula expression required to calculate a cell formatting criterion for Expression and Cell Is rules.

Declaration

property Expression: string index 0 read; write;

Property Value

Type Description
string
Assigned Value
The required formula expression string.
Returned Value
The formula expression’s source text string or an empty string if a parse error has occurred.

Remarks

Use the Expression property to define formatting criteria for a cell range or data item when an Expression or Cell Is conditional formatting rule is applied.

Expression Rule Formatting Criteria

An Expression conditional formatting rule applies appearance settings accessible through the Style property to all cells in the target cell range or data item for which the calculated expression returns TRUE.

Cell Is Rule Formatting Criteria

A Cell Is conditional formatting rule interprets a formula expression or value assigned to the Expression property differently depending on the rule’s ComparisonOperator property value:

cicoEqual | cicoGreaterThan | cicoLessThan | cicoGreaterThanOrEqual | cicoLessThan | cicoLessThanOrEqual | cicoNotEqual
Value Comparison Mode. The rule compares the values of all affected cells to the calculated result of a formula expression assigned to the Expression property. The Expression2 property value is ignored.
cicoBetween | cicoNotBetween
Range Comparison Mode. The rule checks if the values of all affected cells are inside or outside a specific range. Expressions assigned to Expression and Expression2 properties define the value range for comparison.

Refer to the TdxSpreadSheetConditionalFormattingRuleCellIsComparisonOperator type description for detailed information on individual comparison modes.

Expression Syntax

In Spreadsheet and Report Designer controls, formula expressions follow the same syntax as in Microsoft Excel®, and formula operands can refer to individual cells and cell ranges.

Data Item References in Container Controls

In Data Grid, Vertical Grid, and Tree List, you can use the same built-in functions available in Spreadsheet and Report Designer controls. However, formula expressions can refer only to data items[1] rather than individual cells or arbitrary cell ranges.

To refer to a data item in a formula expression, you can use the data item’s caption enclosed in square brackets:

=[Sales]>AVERAGE([Sales],)*1.2

If you use a data-aware grid View, Vertical Grid, or Tree List control, you can also refer to the corresponding dataset field by its name enclosed in curly brackets:

={fieldSales}>AVERAGE({fieldSales},)*1.2

Default Value

The Expression property’s default value is an empty string.

Footnotes
  1. A data item corresponds to an individual field of the underlying dataset. Different container controls display data items in a different manner:

    • A Vertical Grid control displays data items as rows.
    • A Data Grid control’s Table and Banded Table Views display table items as columns. Data items correspond to other visual elements in other grid Views.
    • A Tree List control displays data items as columns.
See Also