Prerequisites for This Example Create Two Queries

Building an Across Group Report 12-3 Figure 12–2 Data Model for Query 1 6. Create another query, this time using the following code: SELECT ALL EMPLOYEES.LAST_NAME, EMPLOYEES.FIRST_NAME, EMPLOYEES.DEPARTMENT_ID FROM EMPLOYEES ORDER BY EMPLOYEES.LAST_NAME

7. Click OK.

8. In the Data Model view, click the Data Link tool in the tool palette.

9. Click and drag your mouse from DEPARTMENT_ID column in Q_1, to

DEPARTMENT_ID1 in Q_2 to create a data link between the two queries. Your data model should now look like this: Figure 12–3 Data Model of the two linked queries

12.3 Create the Default Layout

The steps in this section show you how to use the Report Block Wizard to create the layout and choose how your data will display in your report. Here, you will choose Note: You can also copy and paste the code from the text file provided in the acrossbreak folder, called acrossbreak_ code.txt. Note: You can right-click the data link, then choose Property Inspector from the pop-up menu to ensure that the data link was created properly. 12-4 Oracle Reports Users Guide to Building Reports the style of report you want to create, and choose to display the data across the report hence creating the across group report. To create the default layout: 1. In the Object Navigator, double-click the Paper Layout node to display the Paper Layout view.

2. In the Paper Layout view, choose Insert Report Block to display the Report

Block Wizard.

3. In the Report Block Wizard, on the Style page, select Group Above, then click

Next . 4. On the Groups page: ■ Click G_LAST_NAME in the Available Groups list, then click Across to specify the Print Direction and move this field to the Displayed Groups list. ■ Click G_DEPARTMENT_ID, then click Down. ■ Click Next. 5. On the Fields page, click the right arrow to move the following fields from the Available Fields list to the Displayed Fields list, then click Next: ■ DEPARTMENT_ID ■ DEPARTMENT_NAME ■ LAST_NAME ■ FIRST_NAME 6. On the Labels page, click Next. 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 12–4 Paper Layout view for the across group report

12.4 Run Your Report to Paper

In this section, you will run your report to the Paper Design view so you can see how your report displays. 1. Click the Paper Design button in the toolbar. Your report runs, then displays in the Paper Design view. It should look like the following: