Conditionally Change a Control’s Appearance

media_1449121352995.png

Drop the required fields from the Field List onto the report’s Detail band.

media_1449120986968.png

Select the report by clicking anywhere over the blank area around its bands, and in the Property Grid, locate the Formatting Rules Sheet property and click its ellipsis button.

The invoked Formatting Rule Sheet Editor is intended to manage and customize formatting rules, which then can be defined for the report’s bands and controls.

In this dialog, create a new formatting rule (by using the button), locate its Condition property and, again, click its ellipsis button.

media_1449120972153.png

In the invoked Condition Editor, define the required Boolean condition. In this tutorial, we will format fields if the UnitPrice value is greater than 30.

To save the condition and close the dialog, click OK.

media_1449121019881.png

Now, back in the Formatting Rule Sheet Editor, define the formatting to be applied (e.g. specify the desired font color).

To save the changes and quit the dialog, click Close.

media_1449121067602.png

Select the band or control to which the formatting rule must be applied (in this example it is the Detail band), and in the Property Grid, locate its Formatting Rules property and click its ellipsis button.

 

media_1449121115117.png

If multiple rules are applied, it is possible to customize their precedence, by using the up and down arrow buttons at the right of the dialog.

So, the rules are applied in the same order that they appear in the list, and the last rule in the list has the highest priority.

media_1449121173998.png