40 Building a Report that Includes PL/SQL

In this chapter, you will learn about reports that include PL/SQL. By following the steps in this chapter, you can generate the report output shown in Figure 40-1.

Figure 40-1 PL/SQL report output

Description of Figure 40-1 follows
Description of "Figure 40-1 PL/SQL report output"


Data Relationships

This report uses one query. You will add a function stored in an external library, a report-level function, two formula columns, and a parameter governing the number of records to display before inserting a space.


This report uses the tabular layout style, with minor modifications.

Example Scenario

In this example, you will use an external PL/SQL library and PL/SQL within a report to modify formatting to add spacing between records, and calculate the total compensation for each employee. You will manually create a query in the Data Model view, then modify the layout of the report in the Paper Layout view. You will create formula columns, a summary column, and a format trigger that uses a summary column and a user parameter.

As you build this example report, you will:

To see a sample PL/SQL report, open the examples folder named plsql, then open the Oracle Reports example named plsql.rdf. For details on how to open it, see "Accessing the Example Reports" in the Preface.