Prerequisites for This Example Create a Data Model and a Group Left Layout

Building a Header and Footer Report 16-3

8. Click Next.

9. On the Groups page, click DEPARTMENT_ID and click the right arrow to

move this field to the Group Fields list, then click Next. 10. On the Fields page, click the double right arrows to move all of the fields to the Displayed Fields list, then click Next.

11. On the Totals page, click SALARY, then click Sum.

12. Click Next.

13. On the Labels page, change the labels as follows, then click Next:

This step will add a footer to each instance of the master repeating frame departments.

14. On the Template page, click Finish to display your report output in the Paper

Design view. It should look something like this: Note: You can enter this query in any of the following ways: ■ Copy and paste the code from the provided text file called headfoot_code.txt into the Data Source definition field. ■ Click Query Builder to build the query without entering any code manually. ■ Type the code in the Data Source definition field Note: If you are not already connected to a database, you will be prompted to connect to the database when you click Query Builder or Next. Ensure that you connect to a database that has the appropriate schema for this example. Section 16.1, Prerequisites for This Example describes the sample schema requirements for this example. Fields Labels DEPARTMENT_ID Department SumSALARYPerDEPARTMENT_ID Total Salary for Department DEPARTMENT_ID: Note: The DEPARTMENT_ID column is part of the data model so you need to reference DEPARTMENT_ID in the footer label using DEPARTMENT_ID. 16-4 Oracle Reports Users Guide to Building Reports Figure 16–2 Group left report output with footer for master repeating frame

16.3 Move a Summary

In the Paper Design view, notice how the department summary of salaries is very far to the right of the footer label Total Salary for Department DEPARTMENT_ID. For this report, you will move the salary summary closer to its label. To move the summary closer to its label: 1. In the Paper Design view, click the Flex Off button in the toolbar to turn Flex mode off.

2. Select the label, Total Salary for Department DEPARTMENT_ID.

3. Click and drag the rightmost handle of the label about 0.75 inches 2 centimeters to the left to resize the object.

4. Select the first summary value to the right of the label Total Salary for

Department DEPARTMENT_ID . 5. Click and drag the summary value to the left until it is fairly close to its label. 6. Click and drag the rightmost handle of the field about 1 inch 2.5 centimeters to the left. 7. Click the Flex On button in the toolbar to turn Flex mode back on. Building a Header and Footer Report 16-5 Figure 16–3 Group left report output with summary closer to label

16.4 Add a Page Heading

Now that you have added the repeating frame footer, it is time to add a page header. You perform this task from the Paper Layout view.

1. In the Paper Layout view, click the Edit Margin button in the toolbar.

2. From the font lists in the toolbar, choose Arial Black, point size 16.

3. Click the Text tool in the tool palette.

4. Click somewhere to the right of the logo image and type the following text:

Employee Summary Report

5. Move to an open area of the Paper Layout view and click the mouse button to exit

text mode. Notice that the text object you just created is still selected, you can now adjust its positioning with the arrow keys. If you click in an open area a second time, the object is deselected. 6. Click the Run Paper Layout button in the toolbar to display your report in the Paper Design view. It should look like the following: Note: Similarly, you can add a page footer, below the page margin.