Creating a Report Using the Report Wizard

In this tutorial, you learn how to create a report using the Report Wizard and preview both the Web and paper layouts. You also learn how to enhance the paper report by manipulating the actual, or live, data using the Paper Design view of the Report Editor.

Approximately one half hour

Topics

This tutorial covers the following topics:

Creating a Simple Master-Detail Report

Running the Web and Paper Layouts

Enhancing a Paper Report
Generating Report Output to a PDF File

Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: Because this action loads all screenshots simultaneously, response time may be slow depending on your Internet connection.)

Note: Alternatively, you can place the cursor over each individual icon in the following steps to load and view only the screenshot associated with that step.

Overview

Oracle Reports Developer, a component of Oracle Developer Suite 10g, is a powerful enterprise reporting tool that enables you to rapidly develop and deploy sophisticated Web and paper reports against any data source. Leveraging the latest J2EE technologies, such as JSP and XML, you can publish your reports in a variety of formats to any destination in a scalable, efficient manner.

Reports Builder, the report-building component of Oracle Reports Developer, provides you with the power to develop high quality output for the Web and e-business requirements, as well as high-fidelity printed reports. Reports Builder includes:

user-friendly wizards that guide you through the report design process
pluggable data sources that provide access to data from any source for your reports
a query builder with a graphical representation of the SQL statement to obtain report data
default report templates and layout styles that can be customized if needed
a live editor that allows you to modify paper report layouts in WYSIWYG mode
the ability to add dynamic report output to an HTML page by embedding custom JavaServer Page (JSP) tags within an HTML document
an integrated graph builder to graphically represent report data
tools that dynamically generate Web pages based on your data
standard report output formats such as HTML, HTMLCSS, XML, PDF, PCL, PostScript, and ASCII
event-based reporting (report execution based on database events)
seamless integration of Oracle Reports Developer with OracleAS Portal for administering report security and publishing report output to portlets

Back to Topic List

Before starting this tutorial, you should:

1.

Have access to or have installed Oracle Reports Developer.

2.

Have access to or installed the sample schema. This tutorial uses the HR schema included in the Oracle10g database.

3. Download reportsOBE.zip and unzip into your working directory.

Back to Topic List

Creating a Simple Master-Detail Report

You can use the Report Wizard to build eight styles of reports. The Report Wizard enables you to generate high quality output for the Web, as well as high fidelity paper reports, using the same declarative environment.

 

In this part of the tutorial, you create a simple master-detail report and define both a Web and paper layout.

 

1.

Start Oracle Reports by double-clicking the Reports Builder icon on your desktop. The welcome screen displays.

You have several choices for designing your report. For this tutorial, you will use the Report Wizard (the default).

Place the cursor over this icon to see the image

Click OK.

 

2.

Click Next on the Report Wizard welcome page.

 

3.

The default option is Create both Web and Paper Layout. Click Next to accept this option.

Place the cursor over this icon to see the image

 

4.

On the next page of the Report Wizard, you specify the style of the report that you want to build and can include a title for your report.

Select Group Above as the style and enter Employee Report as the title.

Place the cursor over this icon to see the image

Click Next.

 

5.

For the data source, accept SQL Query as the data source type by clicking Next.

Place the cursor over this icon to see the image

 

6.

On the data source definition page, click Connect to connect to the database.

In the Connect dialog box, enter HR for the User Name, HR for the Password, and the name of your database for the Database field.

Place the cursor over this icon to see the image

Click Connect.

 

7.

You can now type in a SQL statement, define a query visually using Query Builder, or import an existing file. For your convenience, a SQL query is provided for you. Click Import Query.

In the file import dialog box, click Report_Wizard.sql located in your working directory. Click Open.

 

The query fetches employee data from the database.

Place the cursor over this icon to see the image

Now that the query has been defined, click Next to continue.

 

8.

You specified that you wanted to create a Group Above report. The next page of the Report Wizard asks you to choose the field(s) by which you want to group the returned data. For this report, you will group employees by department.

Select DEPARTMENT_ID in the Available Fields list and click the [>] button. The field is now displayed on the right as the first level Group Field.

Place the cursor over this icon to see the image

Click Next to continue.

 

9.

You now need to decide on the fields you want to display in the report. DEPARTMENT_ID is already selected. From the Available Fields list, select EMPLOYEE_ID and click the [>] button. Repeat this process for FIRST_NAME, LAST_NAME, SALARY, and COMMISSION_PCT fields.

Ensure that the displayed fields are in the order shown below. You can drag and drop a field to modify the order.

Place the cursor over this icon to see the image

Click Next.

10.

This page of the Report Wizard enables you to define totals and calculations. For this report, you will display the average salary for each department.

Select the SALARY field in the Available Fields list and click the [Average >] button.

Place the cursor over this icon to see the image

Note the field appears in the Totals list as a calculated field.

Click Next.

 

11.

The wizard now allows you to modify the default labels and widths. For this tutorial, keep the defaults as they are. Click Next.

Place the cursor over this icon to see the image

 

12.

As the final step in the Report Wizard, you can include a template in the report definition. Templates allow you to create a standard look and feel, and also promote reusability. In this tutorial, you will use one of the predefined templates for your report.

Select Gray from the Predefined template list and click Next.

Place the cursor over this icon to see the image

 

13.

Click Finish. You now view the paper layout for your report in the Paper Design view of the Report Editor.

Place the cursor over this icon to see the image

Close the Paper Design window.

 

14.

Save your report as EmployeeReport_<your_initials>.jsp.

To save a report definition, select the report module in the Object Navigator window and click the Save icon in the toolbar , or select File > Save from the menu. The first time you save your report definition, the Save dialog box displays, giving you the opportunity to enter a meaningful name for your report.

Place the cursor over this icon to see the image

Click Save.

 

Back to Topic List

Running the Web and Paper Layouts

Reports Builder provides a number of ways in which you can preview your report.

1.

Recall that you chose to create both a Web and paper layout for this report. To view the Web layout, click the Run Web Layout icon in the toolbar, or select Program > Run Web Layout from the menu.

The Web layout for your Employee Report displays in the default Web browser.

Move your mouse over this icon to see the image

 

2.

To preview the paper layout, click the Run Paper Layout icon on the toolbar, or select Program > Run Paper Layout from the menu.

The paper layout for your Employee Report displays in the Paper Design view.

Place the cursor over this icon to see the image

 

Back to Topic List

Enhancing a Paper Report

The Paper Design view of the Report Editor is a WYSIWYG editor. All edits that you perform in the Paper Design view are on live data. In this part of the tutorial, you will enhance your Employee Report with some commonly required formatting changes and view the live run-time output as you go. To modify the report formatting for the paper layout of your Employee Report, perform the following steps:

Back to Topic List

1.

Ensure that you have the Paper Design view of your report displayed.

Since your report displays salary information, it would be logical to apply a format mask to the data in that column.

Select the Salary column by clicking the data in the column.

Place the cursor over this icon to see the image

With the Salary column selected, click the Currency icon in the stylebar to add a currency symbol to the data in the Salary column. 

Place the cursor over this icon to see the image

 

2.

Keeping the Salary column selected, click the Commas icon to add the thousand separator to the data in the column. Your report output should now look like this:

Place the cursor over this icon to see the image

 

3.

Apply the same formatting to the data displayed in the Average field. The Average field displays the average salary for each department.

Select the Average field by clicking the data in that field.

Place the cursor over this icon to see the image

With the Average field selected, click on the Currency icon in the stylebar to add a currency symbol to the data in the Average field.

Place the cursor over this icon to see the image

 

4.

Keeping the Average field selected, click on the Commas icon to add the thousand separator to the data in the field. Your report output should now look like this:

Place the cursor over this icon to see the image

 

5.

The Employee Report includes the Commission_Pct column, but not all employees earn a commission. Navigate through the pages of the report using the Next Page icon until you reach Department 80. Employees in this department earn a commission. You want to ensure that this column displays two decimal digits to give the data a uniform look.

Select the Commission_Pct column by clicking on data in that column.

Move your mouse over this icon to see the image

 

6.

Keeping the Commission_Pct column selected, click the Add Decimal Place icon twice. Your report output should now look like this:

Place the cursor over this icon to see the image

 

7.

Next, you will customize the title for your report. The title, Employee Report, is a simple text string, referred to as ‘boilerplate text’. You can modify the text color, font, style, and size by using the stylebar, or alternately, the Format menu.

Select the title by clicking on the text string ‘Employee Report'.

Place the cursor over this icon to see the image

 

8.

Keeping the report title selected, use the Font drop-down list in the stylebar to choose a font face of your liking.

Place the cursor over this icon to see the image

 

9.

Modify the size of the font by using the Font Size drop-down list in the stylebar.

Place the cursor over this icon to see the image

Note: Depending on the font size you select, you may need to increase the size of the boilerplate text object. To do this, select one of the object handles and drag it horizontally, or vertically, until the object is sized appropriately and the report title displays in its entirety.

 

10.

You can also modify the text color. Keeping the report title selected, click on the Text Color icon in the vertical toolbar to display the color palette.

Select the color of your choice for the report title.

Place the cursor over this icon to see the image

 

You have successfully customized the look and feel of the paper layout of your report to your liking.

Place the cursor over this icon to see the image

Save your enhancements by clicking Save .


Back to Topic List

Generating Report Output to a PDF File

Reports Builder can generate report output to a PDF file, containing the formatted data and all objects. When you generate your report output to a PDF file, you can distribute the output to any PDF destination, including e-mail, printer, OracleAS Portal, and Web browser.

1.

Select the report in the Object Navigator.

Place the cursor over this icon to see the image

 

2.

Select File > Generate to File > PDF from the menu. Save your report output as EmployeeReport_<your initials>.pdf, such as EmployeeReport_mjs.pdf.

Place the cursor over this icon to see the image

 

Back to Topic List

In this lesson, you've learned how to:

Back to Topic List

Back to Topic List

Place the cursor over this icon to hide all screenshots.