Add Conditional Formatting to the Report

Building a Report with Conditional Highlighting 22-7

11. In the Conditional Formatting dialog box, click New to create your second format

exception. 12. Create a format exception where the values of the SALARY column are between 4999 and 10000 are highlighted in bold.

13. When you are done, click OK. The Conditional Formatting dialog box should now

look like the following: Figure 22–6 Conditional Formatting dialog box

14. Click Apply, then click OK. Your report displays in the Paper Design view, and

should now look something like this: Figure 22–7 FInal Conditional Formatting report 15. Save your report as condhigh_your_initials.rdf. Note: Make sure you type the values in the order described, so that Reports Builder knows to highlight the data between 4999 and 10000, and not 10000 and 4999. 22-8 Oracle Reports Users Guide to Building Reports

22.4 Examine the Conditional Format Trigger Code

The steps in this section will show you the PLSQL code that was automatically generated by Reports Builder when you used the Conditional Formatting dialog box to set up your format exceptions. To examine the automatically generated code:

1. In the Paper Design view, right-click the Salary column on which you just

applied formatting, then choose PLSQL Editor. 2. In the PLSQL Editor, you will see the following code that was automatically generated by Reports Builder. Figure 22–8 PLSQL code for the new format triggers Oracle Reports Builder Note: You can also edit the conditional format trigger code in the PLSQL Editor, but if you attempt to modify the code again in the Conditional Formatting dialog box, your edits will be overwritten by the selections in the dialog box. If you do modify the code in the PLSQL Editor, you will see a warning note when you try to open the Conditional Formatting dialog box. Building a Report with Conditional Highlighting 22-9

22.5 Summary

Congratulations You have successfully built a report that highlights specified data in the report output. You now know how to: ■ use the Report Wizard to create a simple tabular report. ■ format the appearance of your report using tools in the Paper Design view. ■ use the Conditional Formatting dialog box and the Format Exception dialog box to create format triggers that highlight certain data in your report output. ■ examine the code automatically generated by Reports Builder. For more information on any of the wizards, views, or properties used in this example, refer to the Oracle Reports online Help, which is available in Oracle Reports Builder or hosted on the Oracle Technology Network OTN, as described in Section 4.1.1, Using the Oracle Reports online Help . Note: In this code, you can see that the two format exceptions you created comprise two parts of a format trigger. You needed to create two separate format exceptions in the Conditional Formatting dialog box to achieve this effect. If you had tried to create both exceptions simultaneously in the same Format Exception dialog box, your data would not have satisfied both exceptions, and thus would not have been highlighted.