Skip Headers
Oracle® Reports Building Reports
10g Release 2 (10.1.2)
B13895-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

5 Building a Tabular Report

In this chapter, you will learn about tabular reports, the most basic report style. By following the steps in this chapter, you can generate the report output shown in Figure 5-1.

Figure 5-1 Tabular report output

Description of Figure 5-1  follows
Description of "Figure 5-1 Tabular report output"

Concepts

A tabular report is the most basic type of report you can build. The report output is organized in a multicolumn, multirow format, with each column corresponding to a column in the database table. In this example, the column labels Department Id, Department Name, Manager Id, and Location Id are derived from the columns in your SQL SELECT statement, but you can modify column labels as you wish.

Data Relationships

Layout

Example Scenario

As you build this example report, you will:

To see a sample tabular report, open the examples folder named tabular, then open the Oracle Reports example named tabular.rdf. For details on how to open it, see "Accessing the Example Reports" in the Preface.

5.1 Prerequisites for this example

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

5.2 Use the Report Wizard to create a report

When you create a report, you can either use the Report Wizard to assist you or create the report yourself. To build the simple report in this example, you can use the Report Wizard. Using the wizard enables you to define the layout for the report, as well as set the data definition.

To create a simple report:

  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 Tabular, 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 ALL DEPARTMENTS.DEPARTMENT_ID, DEPARTMENTS.DEPARTMENT_NAME, 
    DEPARTMENTS.MANAGER_ID, DEPARTMENTS.LOCATION_ID
    FROM DEPARTMENTS
    ORDER BY DEPARTMENTS.DEPARTMENT_ID
    

    Tip:

    This query selects all the department IDs, the department names, the manager IDs, and the location IDs, then sorts the data by the department IDs.


    Note:

    You can enter this query in any of the following ways:
    • Copy and paste the code from the provided text file called tabular_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.


  8. Click Next.


    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 5.1, "Prerequisites for this example" describes the sample schema requirements for this example.

  9. On the Fields page, click the double right arrows (>>) to move all of the fields to the Displayed Fields list, then click Next.

  10. On the Totals page, click Next.

  11. On the Labels page, click Next.

  12. On the Template page, select Predefined Template and click Beige, then click Finish to display your report output in the Paper Design view. It should look something like this:

    Figure 5-2 Paper Design view for the tabular report

    Description of Figure 5-2  follows
    Description of "Figure 5-2 Paper Design view for the tabular report"


    Note:

    In the Paper Design view, you can see how the tabular report displays the data like a table, in order of department ID number.

  13. Save the report as tabularreport_your_initials.rdf.

5.3 Summary

Congratulations! You have successfully created a tabular paper report. You now know how to:

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 Reports Builder or hosted on the Oracle Technology Network (OTN), as described in Section 3.1.1, "Using the Oracle Reports online Help".