Create the Data Model with Two Linked Queries

24-4 Oracle Reports Users Guide to Building Reports 9. In the Data Model view, follow the steps above to create another query named Q_ EMPLOYEES with the following code: SELECT ALL EMP.DEPTNO, EMP.ENAME, EMP.JOB, EMP.HIREDATE FROM EMP ORDER BY DEPTNO, ENAME 10. In the Data Model view, click the Data Link tool in the tool palette.

11. Drag a link between DEPTNO in Q_PICTURES and DEPTNO1 in Q_

EMPLOYEES . Your data model should now look like this: Figure 24–2 Data Model view for the dynamic graphics report 12. Save your report as dynamicgraphics_your_initials.rdf.

24.3 Create the Layout of the Report

In this section, you will create a default layout for your report using the Report Wizard. You will then modify all the necessary layout objects for your graphics.

24.3.1 Create the initial layout of your report using the Report Wizard

To create the initial layout:

1. In the Paper Layout view, choose Tools Report Wizard to display the 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 Groups page, click the following groups in the Available Groups list and

click Down to specify the Print Direction and move them to the Displayed Groups list: Note: You can enter this query in any of the following ways: ■ Copy and paste the code from the provided text file called dynamicgraphics_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. Building a Report with Dynamic Graphics 24-5 ■ G_deptno ■ G_DEPTNO1 5. On the Fields page: ■ Click the double right arrows to move all of the fields to the Displayed Fields list. ■ In the Displayed Fields list, click deptno, then click the left arrow to move this field back to the Available Fields list. ■ Do the same for DEPTNO1. 6. On the Labels page, delete the label for the Picture field. 7. On the Template page, select No template, then click Finish to display your report layout in the Paper Layout view. It should look something like this: Figure 24–3 Initial Paper Layout view for the dynamic graphics report 8. Save your report as dynamicgraphics_your_initials.rdf.

24.3.2 Modify the layout of your report

Now that you have created an initial layout for your report, you can rearrange your layout objects and add dynamic graphics. To modify your layout: 1. In the Paper Layout view, select all the objects by pressing Ctrl+A on your keyboard. 2. Use the arrow keys on your keyboard to move all the objects 0.5 inches 1.5 centimeters to the right. 3. In the Paper Layout view, expand the screen so that you can see down to 7 inches 18 centimeters on the ruler.

4. In the Object Navigator, find your report name, then navigate to Paper Layout

Main Section Body M_G_DEPTNO_GRPFR .

5. Click R_G_DEPTNO. In the Paper Layout view, the R_G_DEPTNO repeating

frame should also be selected.

6. While the R_G_DEPTNO repeating frame is selected, click the right part of the

frame, and drag it to 6.5 inches 16.5 centimeters. The repeating frame should now expand from the 3.0 inch 7.5 centimeter mark to the 6.5 inch 16.5 centimeter mark on the top ruler. 7. Now, click the bottom part of the frame, and drag it to 2.0 inches 5 centimeters. You can see where you are by looking at the left-hand ruler. The repeating frame should now expand from the 0.5 inch 1.3 centimeter mark to the 2.0 inch 5 centimeter mark on the left-hand ruler.