Prerequisites for This Example Create a Query in the Data Model View

Building a Wrapped Field Report 15-3

5. Click OK to display the data model for your new query in the Data Model view. It

should look like this: Figure 15–2 Data Model for the query

6. In the G_CUST_FIRST_NAME group, click CUST_FIRST_NAME and drag it

above the group to create another group.

7. Click CUST_LAST_NAME, then drag it into the new group, so that the data

model now looks like this: Figure 15–3 Data model with groups

8. Double-click the new group G_1 to display the Property Inspector, and set the

following properties: ■ Under General Information, set the Name property to G_Name. Your data model should now look 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 wrappedbreak_code.txt into the SQL Query Statement field. ■ Click Query Builder to build the query without entering any code manually. ■ Type the code in the SQL Query Statement field. 15-4 Oracle Reports Users Guide to Building Reports Figure 15–4 Data model with new G_Name group 9. Save your report as wrappedbreak_your_initials.rdf.

15.3 Create Three Summary Columns

The steps in this section show you how to use the Summary Column tool in the Data Model view to create three summary columns. These columns will calculate the percentage of each order total that the customer has purchased, the total purchases the customer has made, and the percentage of the total sales of all customers. To create the summary columns: 1. In the Data Model view, click the Summary Column tool in the tool palette, then click in the G_CUST_FIRST_NAME group to create a summary column.

2. 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 PCT. ■ Under Summary, set the Function property to of Total, set the Source property to ORDER_TOTAL, set the Reset At property to G_CUST_FIRST_ NAME, and set the Compute At property to Report.

3. Create a second summary column in group G_NAME with the following

properties: ■ Under General Information, set the Name property to CUST_TOTAL. ■ Under Summary, set the Function property to Sum, set the Source property to ORDER_TOTAL, and set the Reset At property to G_NAME.

4. Create a third summary column in group G_NAME with the following properties:

■ Under General Information, set the Name property to PCT_TOTAL_SALES. ■ Under Summary, set the Function property to Sum, set the Source property to PCT, and set the Reset At property to G_NAME. Your data model should now look something like this: Building a Wrapped Field Report 15-5 Figure 15–5 Data Model with Three Summary Columns

5. Save your report as wrappedbreak_your_initials.rdf.

15.4 Create the Default Layout Using the Report Wizard

The steps in this section show you how to use the Report Wizard to create the layout and choose how your data will display in your report. Here, you will choose the style of report you want to create, and choose to display the data across the report hence creating the across group report. You can create a default layout using the Report Wizard, which deletes any existing layouts in your report and replaces it with the new one. To create the default layout:

1. In the Data Model view, right-click on the canvas, then choose Report Wizard.

2. In the Report Wizard, on the Report Type page, select Create Paper Layout only.

3. On the Style page, select Group Above.

4. On the Fields page, click the double right arrows to move all of the fields to

the Displayed Fields list. 5. On the Labels page, change the field widths as follows:

6. Click Finish to display your report output in the Paper Design view. It should

look something like this: Figure 15–6 Paper Design view for the wrapped field report Fields Width CUST_FIRST_NAME 2 CUST_LAST_NAME 2