Create a user parameter Create a summary column that counts the number of records Modify the layout

Building a Report that Includes PLSQL 40-15 To run your report: ■ Click the Run Paper Layout button in the toolbar. When the Parameter Form displays, click the Run button in the toolbar. Your report displays in the Paper Design view, and should look something like this: Figure 40–16 Final PLSQL example report

40.7 Summary

Congratulations You have successfully built a report that uses an external PLSQL library to calculate employee bonuses, which you can now use in other reports by simply referring to it. You now know how to: ■ create and use an external PLSQL library. ■ create a default layout in the Report Wizard. ■ add vertical space between a user-determined number of records. 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 . 40-16 Oracle Reports Users Guide to Building Reports Building a Paper Report with REF CURSORs 41-1 41 Building a Paper Report with REF CURSORs In this chapter, you will learn about reports that include the PLSQL datatype REF CURSOR. By following the steps in this chapter, you can generate the report output shown in Figure 41–1 . Figure 41–1 REF CURSOR report output Concepts ■ A REF CURSOR is a PLSQL datatype that you can use in a query to fetch data. Each REF CURSOR query is associated with a PLSQL function that returns a strongly typed REF CURSOR. The PLSQL function must ensure that the REF CURSOR is opened and associated with a SELECT statement that has a SELECT list that matches the REF CURSOR type. You base a query on a REF CURSOR when you want to: ■ more easily administer SQL. ■ avoid the use of lexical parameters in your reports. ■ share data sources with other applications. ■ increase control and security. ■ encapsulate logic within a subprogram. ■ If you use a stored program unit to implement REF CURSORs, you receive the added benefits that go along with storing program units in the Oracle database.