|Oracle® Fusion Middleware Oracle Reports Tutorial
11g Release 1 (11.1.1)
Part Number B32123-02
|PDF · Mobi · ePub|
Estimated completion time: 15 minutes
Now that you have created your data set, you need to format the data into your report, and thus provide managers with current information about their employees. To do so, you can create a report block and add it to your report. This report block pulls in the data dynamically using the query you specified in Chapter 1 every time you run the report, and format the data in your report.
The steps in this chapter describe the procedure to add a report block to your Web page as shown in Figure 5-1.
Figure 5-1 Creating a Report Block for your JSP-based Web Report
If you have performed the steps in Chapter 3, "Reviewing the Source Code of the Web Report", you should already have the source open in Reports Builder. In this case, you can skip Step 1. The steps in this section show you how to use the Report Wizard to format the data you specified in Chapter 1, and dynamically pull in the data into your report.
To add a report block
Make sure your report (
.jsp) is open in Reports Builder.
If you did not create
.jsp in Chapter 1, open the
In the Object Navigator, double-click the Web Source node under
In the Web Source view, choose Edit > Find and Replace to find and delete the following text. Note that this text occurs in two places.
Replace this text with the Report block in Chapter 4 of the tutorial.
Ensure that your cursor is in the location where you deleted the text, and choose Insert > Report Block to display the Report Wizard.
Figure 5-2 Inserting the Report Block into your Web Source
On the first page of the wizard, title your report
My Team's Salaries.
Select the Group Above radio button, then click Next.
Format the data so that the employee names list in a downward column, as follows:
On the Groups page, click G_EMPLOYEE_ID, and then click Down to move the group to the Displayed Groups list.
If you did not select the fields in the correct order in Section 2.2, "Using the Data Wizard to Add Data to a Sample Web Page", you may not see this group. If this is the case, copy the SQL text from the
tutorial_sql.txt file into the Query Statement box.
On the Fields page, click the double arrows (>>) to move all Available Fields to the Displayed Fields list.
In the Displayed Fields list, click EMPLOYEE_ID1, then click the left arrow (<) to move the field back to the Available Fields list, and then click Next.
On the Labels page, click Next.
Ensure that Predefined Templates is selected on the Templates page.
Make sure the Beige template is selected, then click Finish.
The Report Wizard has now generated the HTML with custom JSP tags to display your formatted data on the Web page.
Choose File > Save As.
In the Save dialog box, change the name to
.jsp, and click Save.
Click the Run Web Layout button in the toolbar to run and view your report in your Web browser.
If Netscape 7.0 is your default browser, and the browser does not display, set the registry key
HKEY_CURRENT_USERS\Software\Oracle\Toolkit\Tkbrowser to the default browser location. Ensure that the
BrowserName and the
BrowserPath keys reflect the correct values. For example:
Your report should look something like this:
Figure 5-3 JSP-based Web Report with Report Block
You can also run the
empreva.jsp file by opening the JSP in Reports Builder, and running it to the Web.
Congratulations! You have added a report block to a Web report. You now know how to:
Create a report block
Add a report block to an HTML page for a JSP-based Web report
To review your results, continue on to Chapter 4, "Reviewing the Source Code for the Report Block". Otherwise, skip to Chapter 6, "Creating a Graph for the Web Report" to add a graph to your report.