Create a new report manually Create a data model with a cross product and a data link

25-6 Oracle Reports Users Guide to Building Reports

2. Click and drag from the DEPTNO column in the G_DEPTNO group to the

DEPTNO1 column in the G_DEPTNO1 group.

3. Repeat steps 1 and 2, but this time drag the link between the JOB column in G_

JOB and JOB1 in G_DEPTNO1. Figure 25–5 Three query data model with cross product group and data links

25.3.3 Create the layout with the Report Wizard

Once your data model is complete, you need to create a layout for the data objects to display in the report output. To create the 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 Matrix.

4. On the Groups page, ensure that all of the groups from your data model appear in

the Displayed Groups list. G_1 should be Matrix, G_DEPTNO should be Down, G_JOB should be Across, and G_DEPTNO1 should be Down. Figure 25–6 Groups page of the Report Wizard

5. On the Fields page, ensure that only the following columns appear in the

Displayed Fields list: ■ DEPTNO Building a Matrix Report 25-7 ■ JOB ■ SUM_SAL Figure 25–7 Fields page of the Report Wizard

6. On the Labels page, delete the labels for all of the fields.

7. On the Template page, make sure Beige is selected under Predefined Template,

then click Finish to display your report output in the Paper Design view. It should look like this: Figure 25–8 Paper Design view for the matrix report

25.4 Add Summaries to the Single-Query Matrix

To make your matrix report more useful, you should add summaries of each row and column in the matrix, and the whole report. In the single-query case, you can add these summaries very easily with the Report Wizard. In the multiquery case, you would need to add the summaries manually and then use the Report Wizard to create fields for them. The steps below describe the procedure for adding summaries to the single-query matrix. To add summaries to a single-query matrix:

1. Return to the Report Wizard by choosing Tools Report Wizard.

25-8 Oracle Reports Users Guide to Building Reports

2. On the Report Type page, select Create Paper Layout only.

3. On the Totals page, click SUM_SAL in the Available Fields list, then click Sum.

4. Click Finish to preview your report output in the Paper Design view.

25.5 Format Monetary Values

To make your report easier to read, you can add formatting to the monetary values. To format monetary values:

1. On the first page of the report, click one of the cell values. Notice that all of the

values are immediately selected, indicating that you can change their properties simultaneously.

2. Shift-click one of the summary values at the bottom of a column of the matrix.

3. Click the Currency button in the toolbar. A currency symbol immediately appears

next to all of the values.

4. Click the Add Decimal Place button in the toolbar twice. Two decimal places are

added to the right of the decimal point.

5. Resize the fields. Click and drag the rightmost handle of the cell value under the

SALESMAN label about 0.5 inches 1.5 centimeters to the left. After you complete this operation, the department summaries from the second page should move onto the first page.

6. Shift-click the SALESMAN label.

7. Click the Align Right button in the toolbar.

8. Click in an open area of the Paper Design view to deselect all of the objects.

9. Click one of the department summaries at the end of a row in the matrix. All of the

department summaries are immediately selected.

10. Shift-click the report summary underneath the department summaries.

11. Use the left arrow key to move these summaries to the left until they are

approximately flush with the SALESMAN column in the matrix. Note: Although you can use the Report Wizard to add summaries to a single-query matrix, you cannot use this method for a multiquery matrix. Tip: You may have to use the arrows to make the Totals tab visible. Note: When your new layout is created, you should notice a couple of things. First, at the bottom of each column of the matrix, you should now see a summary of that columns values. The report is also probably more than one page long now. Because of the width of the layout, the summaries for the departments cannot fit on the page with the rest of the matrix. Hence, the department summaries and the report summary overflow to the next page. Go to the second page of the report and you will see the department summaries and the report summary.