Modifying a formatting rule
To modify a formatting rule, use the same highlight tool that you use to create the rule. Select the element for which you want to modify the formatting rule, choose the Highlights tab in Property Editor, then double‑click the rule to modify. You can change any part of the rule, such as the condition that triggers the formatting or the format properties to apply. The modified rule takes effect the next time you run the report.
How to modify a formatting rule
1 In the layout editor, select the element whose formatting rule you want to modify.
2 In Property Editor, choose Highlights. The Highlights page displays the formatting rule or rules for the element.
3 Double-click the rule you want to modify. Edit Highlight displays the elements that make up the rule.
4 Make the desired changes, then choose OK.
Creating multiple formatting rules
You can create multiple formatting rules for an element. For example, you can create three rules to set the values of an order total data element to one of three colors, depending on the dollar amount. Figure 8‑22 shows an example.
Figure 8‑22 Highlights page showing multiple format rules for an element
You can create any number of rules, and you can base conditions on the value of the selected element or on the value of other elements. Using the previous example, you can also change the color of the order total value based on the value of another data element, such as order ID. Figure 8‑23 shows this example.
Figure 8‑23 Conditional format for orderTotal based on the value of orderID
For each row of data, BIRT Report Designer evaluates the rules in the order in which they appear in the list of rules. As it evaluates each rule, BIRT Report Designer applies the specified format properties if the condition is met. If multiple rules with different conditions use the same format property, the later rule can override the format that the earlier rules specify.
Consider the following example:
*The first rule sets order total values to red if they are less than 100000.
*The fourth rule sets order total values to blue if the order ID is larger than 1090.
If an order total value is 50000 and the order ID is 2000 (the conditions in both rules are true), the order total value appears in blue, not red, because the fourth rule supersedes all rules before it. If, however, the fourth rule sets order total values to italics rather than to blue, the value appears in red and italics.
When creating multiple rules for an element, plan the rules carefully. Consider the effect of individual rules and how the order of the rules changes the results. Test thoroughly to verify that the report displays the results that you expect. If necessary, change the order of the rules by selecting a rule and moving it up or down the list using the Move Up or Move Down buttons on the Highlights page.
Deleting a formatting rule
All formatting rules that you create for an element take effect when you run the report. If you do not want a formatting rule to apply to an element, delete the rule from the Highlights page of the selected element.
How to delete a formatting rule
1 In the layout editor, select the report element whose formatting rule you want to delete.
2 In Property Editor, choose Highlights. The Highlights page displays the formatting rule or rules for the element.
3 Select the rule you want to delete, then choose Remove.