Using conditional formatting, you can apply formatting based on the outcome of pre-set conditions (set at design time) and checked at run time. Conditional formatting is applied at runtime on a field or a label control as shown in the examples below:
- Display the record in Bold if result of a student is ‘Fail’.
- Display the figure in red and in braces if the profit figure is ‘Negative’.
- Display the sales value in light blue background if the sales target is met, in yellow if the target is missed by up to 25 %, and in red if it is missed by more than 25%.
Before applying conditional formatting, you should set the required conditions and required formats.
To apply formats to controls
Conditional formats are applied to a control or a label using Conditional Formatting screen. Before opening the Conditional Formatting screen, select the control on which the format is to be applied.
To access Conditional Formatting screen,
- On the Desktop Studio screen, click button from the toolbar.
- On the Desktop Studio screen, from Format menu, click Conditional Formatting. The Conditional Formatting screen appears.
Figure 8: Conditional Formatting screen
You can perform the following actions:
|Add||To create/add a new conditional format|
|Delete||To delete the selected conditional format|
|Import||To import the pre-existing conditional formatting|
|Export||To export the newly created conditional formatting|
|Conditions||To open Conditions screen to create a new condition|
|Formats||To open Styles screen to create a new style/format|
|OK||Save all the changes made to the condition|
|Cancel||Close screen without making changes to the report|
To apply/create conditional formatting
On the Conditional Formatting screen,
- Click Add The Conditional Formatting screen appears.
- Select a condition from On Condition drop-down list, for which you want to apply a format.
- Select the format from Apply Style drop-down list that you want to apply for the selected condition of the control.
Note: When you apply styles to a control from style drop down box, respective properties of the control will not automatically change (in property pane).
- After applying formatting preferences for all the conditions, click OK button to save the created conditional formatting. The newly designed conditional formatting appears in the list on the Conditions Formatting.