Creating A Report Using The Report Wizard
Creating A Report Using The Report Wizard
Purpose
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.
Time to Complete
Approximately one half hour
Topics
This tutorial covers the following topics:
Overview
Prerequisites
Creating a Simple Master-Detail Report
Running the Web and Paper Layouts
Enhancing a Paper Report
Generating Report Output to a PDF File
Summary
Related information
Viewing Screenshots
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
Prerequisites
Before starting this tutorial, you should:
1.
2.
Have access to or installed the sample schema. This tutorial uses the HR schema included in the
Oracle10gdatabase.
3.
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).
Click OK.
3. The default option is Create both Web and Paper Layout. Click Next to accept this option.
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.
Click Next.
5. For the data source, accept SQL Query as the data source type by clicking Next.
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.
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.
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.
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.
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.
11. The wizard now allows you to modify the default labels and widths. For this tutorial, keep the defaults as they are.
Click Next.
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.
13 Click Finish. You now view the paper layout for your report in the Paper Design view of the Report Editor.
.
Click Save.
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.
2.
To preview the paper layout, click the Run Paper Layout icon
Layout from the menu.
The paper layout for your Employee Report displays in the Paper Design view.
2.
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.
4.
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.
6.
Keeping the Commission_Pct column selected, click the Add Decimal Place icon
should now look like this:
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'.
8. Keeping the report title selected, use the Font drop-down list in the stylebar to choose a font face of your liking.
9. Modify the size of the font by using the Font Size drop-down list in the stylebar.
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
toolbar to display the color palette.
in the vertical
You have successfully customized the look and feel of the paper layout of your report to your liking.
2.
Select File > Generate to File > PDF from the menu. Save your report output as EmployeeReport_<your
initials>.pdf, such as EmployeeReport_mjs.pdf.
Summary
In this lesson, you've learned how to:
Create a master-detail report using the Report Wizard
Preview the Web and paper layouts for a report
Enhance a paper report with common formatting attributes using the Paper Design view of the Report Editor
Generate report output to a PDF file
Back to Topic List
Related Information
To learn more about Oracle Reports 10g, refer to the additional Reports OBEs.
Visit the OTN Web site for technical papers, presentations, frequently asked questions, demonstrations, and
more.
Back to Topic List