Conditional formatting options can be set for an entire
column of data in the query results or for each detail, summary and
grand total cell in a column. Based on the evaluation of a conditional
expression, each column and cell in the query results can have a unique
set of formatting attributes.
About this task
For example, within a column, you could specify that if
a cell's content equals 0, then display the cell with a red background
and if the value is 100, display the cell with a blue background.
To
set conditional formatting:
Procedure
- Open the Layout Properties window. You can specify conditional
formatting from either the Font page or the Format
page depending on what results you want to apply to the data in the cell or column.
- Apply conditional formatting.
- Click the Detail branch to apply conditional formatting to the
detail cells of the column.
- Click the column name Total branch to apply conditional
formatting to the summary cell of the column.
- Click the Grand Total branch to apply conditional formatting to
the grand total cell of the column.
- With the appropriate branch selected, click the Add icon. The
control fields Condition name and Condition Expression
become available.
- Provide a unique name to each conditional expression that you create by typing the name
of the expression in the Condition name field.
A branch is automatically created in the tree using the condition name.
Each condition must have an expression.
- Type the expression in the Condition Expression field.
You must follow the rules for building conditional formatting expressions. The expression
language supports constant expressions, expressions defined as variables sourced on other columns in
the result set (1, 2, for example), numeric operators (such as +, -, *, /), character operators (+,
CONCAT), numeric and character functions (see the full
list of functions here), and a set of logical and relational operators (such as &&, ||, !,
===, !==).
- After you have created the expression, select the Font or the
Format page of the Layout Properties window to specify
the formatting that will be applied to any cell in the column that meets the conditions set in the
expression.
Note: If you make any changes after from the Design tab after you have
applied the conditional formatting, it is recommended to re-run the query.