Conditionally change the appearance of a control

This procedure describes the steps to conditionally change a control's appearance.

  1. Create a new report.
  2. Drag the required fields from the Field List onto the report's Detail band.
    Filter data

    For more information, see Report bands.

  3. Select the report by clicking anywhere over the blank area around its bands, and in the Property Grid click the browse button (...) for the Formatting Rules Sheet property.
    This opens the Formatting Rule Sheet Editor dialog box, which you can use to manage and customize formatting rules for the report's bands and controls.
  4. In the Formatting Rule Sheet Editor, click the Add button to create a new formatting rule, and click the browse button (...) for the Condition property.
    Filter data
  5. In the Condition Editor, define the required Boolean condition.
    In the figure, fields are formatted if the UnitPrice value is greater than 30.
    Formatting rules
  6. Click OK to save the condition and close the Condition Editor dialog box.
  7. Back in the Formatting Rule Sheet Editor, define the formatting to be applied.
    Formatting rules
  8. Select the band or control to which to apply the formatting rule (for example, the Detail band), and in the Property Grid, click the browse button (...) for the Formatting Rules property.
  9. In the Formatting Rules Editor, select the rule and click the > button to move the formatting rule from the Available Rules box to the Applied Rules box.
    Formatting rules

    The rules are applied in the same order that they appear in the list. The last rule in the list has the highest priority. You can move a rule up and down the list with the up and down arrow buttons.

    The result is shown in the figure.

    Formatting rules