Refine the Data Model

41-10 Oracle Reports Users Guide to Building Reports ■ Under Summary, set the Function property to Count, set the Source property to employee_id, and set the Reset At property to G_department_id. You have now created a summary that counts up the number of employees. You will not use the summary in this reports layout, but you will use it as the source for other, more interesting summaries later. 4. Repeat the steps above to create summaries with the following characteristics: You may not understand these summaries now. Their purpose will become clearer when you create the report layout and preview the live data. Your data model should look similar to the following: Figure 41–7 Data model with summary columns 5. Save the report as ref_65_your_initials.rdf.

41.7 Create a Layout

Now that you have a working data model, the steps in this section will help you to create a layout. To create a paper layout:

1. In the Object Navigator, right-click the report name and choose Report Wizard.

Table 41–2 Summary Characteristics Create in Group Name Function Source Reset At G_conlabel CS_conlabel_ classcount Sum CS_classcount G_conlabel G_ department_ id CS_port_count Sum CS_conlabel_ classcount G_ DEPARTMENT_ ID Note: You can also compare your results to the file we have provided, called ref_emp65.rdf. Building a Paper Report with REF CURSORs 41-11

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

3. On the Style page, type My Employees in the Title field, select Group Above.

4. On the Groups page, click the following fields in the Available Fields list and

click Down to specify the Print Direction and move them to the Group Fields list: ■ G_conlabel ■ G_DEPARTMENT_ID ■ G_EMPLOYEE_ID 5. On the Fields page, click the following fields and click the right arrow to move them to the Displayed Fields list: ■ DEPARTMENT_NAME ■ EMPLOYEE_ID ■ START_DATE ■ END_DATE ■ JOB_ID ■ CS_port_count 6. On the Labels page, change the labels and field widths as follows:

7. On the Template page, choose Predefined template and click Beige, then click

Finish to display your report output in the Paper Design view. It should look something like this: Table 41–3 Field description of Labels page Fields Labels Width DEPARTMENT_NAME Department 30 EMPLOYEE_ID Employee ID 8 START_DATE Start Date 9 END_DATE End Date 9 JOB_ID Job ID 10 CS_port_count Total: 12