Conditionally Change a Control's Appearance

This document describes the steps needed to conditionally change a control's appearance (e.g., make a Label's formatting rules feature, no scripts are required to achieve this, so you shouldn't write any code.

To conditionally change a control's appearance, do the following.

  1. Create a new report and bind it to a data source.

  2. Switch to the Properties Panel, Appearance category and then expand the Formatting Rules section. Add a new formatting rule by clicking the button.

  3. Expand the newly added rule, specify its name and formatting options (e.g., Foreground Color). Data Source and Data Member properties. These properties define the list containing data fields that can participate in constructing the Boolean condition.

  4. Then, click the ellipsis button for the Condition property. In the invoked Expression Editor, UnitPrice value is greater than 30.

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

  5. A formatting rule can be applied to any number of report elements within the same report. To apply a rule to a control, select the required report control and enable the checkbox for the required rule.

    If multiple rules are applied, it is possible to customize their precedence by using the and buttons. 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.

Switch your report to the Preview mode and view the result.