Reference Fields Summary Oracle Fusion Middleware Online Documentation Library

19-10 Oracle Reports Users Guide to Building Reports page number boilerplate text object to lengthen it to ensure that no values for F_ TOTAL_PAGENO get truncated. 6. Save and run your report. Your final report output should look something like this: Figure 19–8 Final pages renumbered by repeating frame report output

19.8 Summary

Congratulations You have successfully created a report that renumbers pages by repeating frame. You now know how to: ■ create a data model with a group above layout. ■ add a second query to create a multiquery report, and redefault the layout. ■ set properties and format fields. ■ create and reference a page number boilerplate object in your layout. For more information on any of the wizards, views, or properties used in this example, refer to the Oracle Reports online Help, which is available in Oracle Reports Builder or hosted on the Oracle Technology Network OTN, as described in Section 4.1.1, Using the Oracle Reports online Help . Building an Intermixed Fields Report 20-1 20 Building an Intermixed Fields Report In this chapter, you will learn about reports that display group fields in different positions. By following the steps in this chapter, you can generate the report output shown in Figure 20–1 . Figure 20–1 Group with master record in the middle of report output Concepts Normally, a group break field appears to the left of in group left report or above in group above report its related fields. In this example, the group field appears between its related fields. Data Relationships ■ To create this type of report you need to build a data model with two groups. ■ A formula column in the detail group returns the value of the group column. The formula column is moved to the middle position of its group. Layout ■ This report uses a group above layout. In the Paper Layout view, the break column is deleted from its defaulted position. ■ A format trigger is created to suppress redundant printing of the formula column group value in the detail group. 20-2 Oracle Reports Users Guide to Building Reports Example Scenario In this example, you will create a report that displays salary data by employee and department. Your users have indicated to you that they prefer the group value that is, department name to appear in the middle of the layout with employee names to the left and employee salaries to the right. As you build this example report, you will: ■ Create a Data Model and a Layout using the Report Wizard. ■ Add a Formula Column to the detail group. ■ Add a Field in the Report Wizard. ■ Remove a Redundant Field in the Paper Design view. ■ Suppress Redundant Values in a Format Trigger. To see a sample report that intermixes fields, open the examples folder named intermix, then open the Oracle Reports example named intermix.rdf. For details on how to access it, see Accessing the Example Reports in the Preface.

20.1 Prerequisites for This example

To build the example in this chapter, you must have access to the SCOTT sample schema provided with the Oracle Database. If you do not know if you have access to this sample schema, contact your database administrator.

20.2 Create a Data Model and a Layout

When you are creating a single-query report, such as this one, you can use the Report Wizard to create the data model and layout simultaneously. To create a data model and group above layout:

1. Launch Reports Builder or, if already open, choose File New Report.

2. In the Welcome or New Report dialog box, select Use the Report Wizard, then

click OK. 3. If the Welcome page displays, click Next. 4. On the Report Type page, select Create Paper Layout Only, then click Next. 5. On the Style page, type a Title for your report, select Group Above, then click Next .

6. On the Data Source page, click SQL Query, then click Next.

7. On the Data page, enter the following SELECT statement in the Data Source

definition field: SELECT DEPT.DNAME, EMP.ENAME, EMP.SAL FROM DEPT, EMP WHERE EMP.DEPTNO = DEPT.DEPTNO Building an Intermixed Fields Report 20-3

8. Click Next.

9. On the Groups page, click DNAME in the Available Fields list and click the right

arrow to move this field to the Group Fields list. Figure 20–2 Group page of Report Wizard

10. Click Next.

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

the Displayed Fields list, then click Next. 12. On the Totals page, click Next. 13. On the Labels page, change the labels as follows, then click Next: Note: You can enter this query in any of the following ways: ■ Copy and paste the code from the provided text file called intermix_code.txt into the Data Source definition field. ■ Click Query Builder to build the query without entering any code manually. ■ Type the code in the Data Source definition field. Note: If you are not already connected to a database, you will be prompted to connect to the database when you click Query Builder or Next. Ensure that you connect to a database that has the appropriate schema for this example. Section 20.1, Prerequisites for This example describes the sample schema requirements for this example. Fields Labels DNAME Dept. ENAME Name SAL Salary