Create a Second Query in the Data Model Create a Report Block to Display the Table of Contents

36-8 Oracle Reports Users Guide to Building Reports Figure 36–4 Paper Layout view of the Header Section

10. Click the Field tool in the tool palette and create a field above the PAGE field, next

to the F_MAIN_TOPIC field.

11. Double-click the new field object to display the Property Inspector, and set the

following properties: ■ Under Field, set the Source property to Subcategory_Page. ■ Under Summary, set the Reset At property to G_1. 12. Save your report.

36.6 Run Your Multilevel Table of Contents Report to Paper

The steps in this section will show you how to make a few modifications in the Paper Layout view and run your report. To modify and run your report to paper: 1. In the Paper Layout view, change the font of the field F_1 to Arial, Bold. 2. Change the Fill color to any color for example, Beige, and the Line Color to No Line Color .

3. Click the Run Paper Layout button in the toolbar.

The table of contents displays on the first page of the report, and looks something like the following: Note: To generate the table of contents TOC, you must click the Run Paper Layout button. If you click the Paper Design view button, the change of format order will not take effect, thus the TOC will not be generated. Building a Paper Report with a Multilevel Table of Contents 36-9 Figure 36–5 Table of contents page of the report In this example, under the BOYS product department, the SHIRTS sub-category starts at page 22 and the next sub-category, SHOES, starts at page 38. If you move to any page between page 22 and 38 in the report, you will see the SHIRTS sub-category. Figure 36–6 Results for the BOYS product department and SHIRTS sub-category You can navigate to various pages in your report to view the data for each department and sub-category. Note: The page numbers may differ depending upon the data used in your report. 36-10 Oracle Reports Users Guide to Building Reports

36.7 Summary

Congratulations You have successfully created a report with a multilevel table of contents. You now know how to: ■ create a multilevel table of contents for a large paper report. ■ Use the SRW.SET_FORMAT_ORDER built-in procedure to change the order in which the report sections are formatted. ■ create a format trigger that fetches the page numbers for categories and subcategories that you specify. ■ use the Report Block Wizard to create a simple group above report layout to display your table of contents. 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: At this point, you can compare your report against the example file we have provided, multilevel_toc.rdf. First, compile the PLSQL by choosing Program Compile All, then run the report to paper.