Create a Parameter Form

34-8 Oracle Reports Users Guide to Building Reports Figure 34–5 Data Model view of the Ranking Report 5. Save your report. To create a parameter for the percentage cutoff:

1. In the Object Navigator, under the Data Model node, click the User Parameters

node.

2. Choose Edit Create to create a new user parameter under the User Parameters

node. 3. If the Property Inspector is not already displayed, right-click the new user parameter P_1, then choose Property Inspector to display the Property Inspector, and set the following properties: ■ Under General Information, set the Name property to CUTOFF_PCT. ■ Under Parameter, set the Datatype property to Number, set the Width property to 2, and set the Initial Value property to 75.

4. In the Data Model view, click the group object G_CNAME2, then click and drag

the bottom handle down about 0.25 inches 0.5 centimeters to make the group bigger. 5. Click the Summary Column tool in the tool palette.

6. Click in the empty space beneath SUM_AMT2 to create a summary column.

7. Double-click the new summary column object CS_1 to display the Property

Inspector, and set the following properties: ■ Under General Information, set the Name property to R_PCT. ■ Under Column, set the Datatype property to Number, and set the Width property to 10. ■ Under Summary, set the Function property to of Total, set the Source property to SUM_AMT2, set the Reset At property to Report, and set the Compute At property to Report. To create a second layout for the list of customers by percentage: 1. Click the Paper Layout button in the toolbar to display the Paper Layout view. 2. In the Paper Layout view, click the Report Block tool in the tool palette. 3. Starting about 1 inch 2.5 centimeters below the existing layout, click and drag a box about the same size as the existing layout to define the size of the second layout and display the Report Block Wizard.

4. On the Style page of the Report Block Wizard, select Tabular, then click Next.

Building a Ranking Report 34-9

5. On the Groups page, click G_CNAME2 in the Available Groups list and click

Down to specify its Print Direction and move this group to the Displayed Groups list, then click Next. 6. On the Fields page, click the following fields and click the right arrow to move them to the Displayed Fields list, then click Next: ■ CNAME2 ■ SUM_AMT2 7. On the Labels page, change the labels and field widths as follows, then click Next:

8. On the Template page, select No template. If you were to select a template, it

would override the template of the previous layout, then click Finish to display your report layout in the Paper Layout view.

9. From the font lists in the toolbar, choose Arial Western, point size 10.

10. In the Paper Layout view, click the Text tool in the tool palette.

11. Click directly above the label Customer Name in the new layout and type the

following text in the new boilerplate text object: Top CUTOFF_PCT Percent of Sales: 12. 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. 13. If the text is not already bold, click the Bold button in the toolbar to make it bold.

14. Shift-click the labels Customer Name and Total Purchases so that they are

selected simultaneously with the object you just created. 15. Click the Underline button in the toolbar. 16. Click in an open area of the Paper Layout view to deselect everything.

17. Double-click field F_SUM_AMT2 to display the Property Inspector, and set the

following properties: ■ Under Field, set the Format Mask property by typing: -NNN,NN0.00 To add the logic for the percentage cutoff:

1. In the Object Navigator, type R_G_CNAME2 in the Find field to locate that

repeating frame.

2. Double-click the properties icon next to R_G_CNAME2 to display the Property

Inspector, and set the following properties: ■ Under Advanced Layout, double-click the Format Trigger property field to display the PLSQL Editor. 3. In the PLSQL Editor, use the template to enter the following PLSQL code: function R_G_CNAME2FormatTrigger return boolean is Fields Labels Width CNAME2 Customer Name 35 SUM_AMT2 Total Purchases 15