Create a report-level function that calculates total compensation

40-10 Oracle Reports Users Guide to Building Reports

6. Click Next.

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

8. On the Template page, click Finish to display your report layout in the Paper

Layout view. It should look something like this: Figure 40–10 Paper Layout view of the PLSQL example report

9. Click the Run Paper Layout button in the toolbar to run and display your report in

the Paper Design view. 10. In the Paper Design view, click the Flex Off button in the toolbar.

11. Delete the Last Name label.

12. Change the text for the First Name label to Name.

13. Adjust the width of the new Name label to span over both the first name and last

name columns. 14. Adjust the sizes of the first name and last name columns so that one character displays between the columns.

15. In the Object Navigator, double-click the properties icon next to the F_FIRST_

NAME field to display the Property Inspector, and set the following properties: ■ Under General Layout, set the Vertical Elasticity property to Fixed, and set the Horizontal Elasticity property to Variable.

16. Repeat the above step for the F_LAST_NAME field.

17. Click the Paper Layout button in the toolbar to display the Paper Layout view. 18. In the Paper Layout view, click the Frame tool in the tool palette.

19. Draw a frame around the two fields: F_FIRST_NAME and F_LAST_NAME.

20. With the frame selected, choose Tools Property Inspector to display the

Property Inspector, and set the following properties: ■ Under General Information, set the Name property to M_NAME. 21. In the Paper Layout view, make sure Flex Off is selected in the toolbar.

22. With the frame selected, choose Layout Move Backward until the frame

encloses both the F_FIRST_NAME and F_LAST_NAME fields. Note: If the fields do not display in the correct order, simply click the field name and drag the field to the correct position in the list. Fields Labels COMMISSION_PCT Commission TOTAL_COMP Total Compensation Building a Report that Includes PLSQL 40-11 When you are done, the Object Navigator should look like this: Figure 40–11 Object Navigator with M_NAME repeating frame

23. Click the Paper Design button in the toolbar to display the report in the Paper

Design view. 24. In the Paper Design view, Shift-click the values under the following columns: ■ Salary ■ Commission ■ Bonus ■ Total Compensation 25. Click the Currency button in the toolbar to add to the numbers.

26. Click the Add Decimal Place button twice to add two decimal points to the

numbers.

27. Shift-click the Salary, Commission, Bonus, and Total Compensation column

headings to select them too.

28. Click the Align Right button to right justify the columns.

Your report should now look something like this: Figure 40–12 Paper Design view of modified report

29. Save your report.

Tip: You can watch the fields in the Object Navigator as you choose Layout Move Backward. When you see the two fields are sub-nodes of M_NAME, stop.