Oracle® Fusion Middleware Oracle Reports User's Guide to Building Reports 11g Release 1 (11.1.1) B32122-01 |
|
![]() Previous |
![]() Next |
In this chapter, you will learn about reports that display highlighted values based on one or more conditions. By following the steps in this chapter, you can generate the report output shown in Figure 22-1.
Figure 22-1 Conditional highlighting report output
Concepts
You can create a format trigger that will change the appearance of retrieved data depending on factors you define.
You can use the Conditional Formatting dialog box to create this format trigger, or you can manually create them using the PL/SQL Editor. The steps in this example will show you how to use the Conditional Formatting dialog box, then display the code in the PL/SQL Editor to see how the format trigger was automatically generated by Reports Builder.
With conditional highlighting, you can format specified portions of a report's output when certain criteria are met.
Data Relationships
This report uses one query to fetch all data.
Layout
This report uses a tabular layout style. To add conditional highlighting, you will use the Conditional Formatting dialog box to determine which names and salaries will be highlighted in the report output.
Example Scenario
In this example, you will create a report for managers that shows a complete list of employees in the company, but also highlights employee salaries that are greater than or equal to $10,000. You also need to indicate which employees' salaries are between $4,999 and $10,000. In this example, you will use conditional formatting to highlight these figures in bold and red text.
As you build this example report, you will:
Create a Basic Tabular Report using the Report Wizard to included a single query.
Add Conditional Formatting to the Report using the Conditional Formatting dialog box to highlight specific data in the report.
Examine the Conditional Format Trigger Code using the PL/SQL Editor, for the format trigger generated by Reports Builder.
To see a sample report that uses conditional highlighting, open the examples folder named condhigh
, then open the Oracle Reports example report named condhigh.rdf.
For details on how to open it, see "Accessing the Example Reports" in the Preface.