Skip Headers

Oracle9i Reports Tutorial
Release 9.0

Part Number A90900-01
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

4
Creating a Report Block for the Web Report

Estimated completion time: 15 minutes

Now that you've created your data set, you want to format the data into your report to provide managers in your company with current information about their employees. To do so, you can create a report block and add it to your report. This report block will dynamically pull in the data 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 will show you how to add a report block to your Web page.

Figure 4-1 Creating a Report Block for your JSP-based Web Report

Text description of repblk_xg.gif follows.

Text description of the illustration repblk_xg.gif

4.1 Add a report block to your Web page

If you completed Chapter 3, "Reviewing the Source Code of the Web Report", you should already have the source open in Reports Builder, and 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:

  1. Make sure your report (emprev_<your initials>.jsp) is open in Reports Builder.


    Note:

    If you did not create emprev_<your initials> in Chapter 1, simply open the Web page we've provided, named emprev.jsp.


  2. In the Object Navigator, double-click the Web Source node under emprev_<your initials>.

  3. In the Web Source view, choose Edit > Find to find and delete the following text (note that this text is in two different places that state "Replace"):

    <!-- Replace this text with the Report block in Chapter 4 of the 
    tutorial.-->
    


    Warning:

    Make sure you delete the entire line of HTML (including the &lt tags). There are two locations in the source code where you will replace text. Be sure to delete only the text identified with Chapter 4. This location is where you will add a report block.


  4. Make sure your cursor is in the location where you deleted the text, and choose Insert > Report Block to display the Report Wizard.

Figure 4-2 Inserting the Report Block into your Web Source

Text description of repblk_add.gif follows.

Text description of the illustration repblk_add.gif

  • On the first page of the wizard, title your report "My Team's Salaries" and select the Group Above radio button, then click Next.

  • Let's format the data so that the employee names list in a downward column.

    On the Groups page, click G_EMPLOYEE_ID, then click Down to move the group to the Displayed Groups list.


    Note:

    If you did not select the fields in the correct order in Section 2.2, "Use 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 tutorial_sql.txt into the Query Statement box.


  • Click Next.

  • On the Fields page, click the double arrows to move all Available Fields to the Displayed Fields list, then click Next.

  • On the Templates page, select the Predefined Templates radio button.

  • Choose the Beige template, 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 empreva_<your initials>.jsp and click Save.

  • Click the Run Web Layout icon in the toolbar to run and view your report in your Web browser. Your report should look something like this:

    Figure 4-3 JSP-based Web Report with Report Block

    Text description of repblk_fin.gif follows.

    Text description of the illustration repblk_fin.gif


    Note:

    You can also run the empreva.jsp file we've provided by opening the JSP in Reports Builder, and running it to the Web.


    4.2 Summary

    Congratulations! You have added a report block to a Web report. You now know how to:

    To review your results, continue on to Chapter 5, "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.


  • Go to previous page Go to next page
    Oracle
    Copyright © 2002 Oracle Corporation.

    All Rights Reserved.
    Go To Documentation Library
    Home
    Go To Product List
    Solution Area
    Go To Table Of Contents
    Contents
    Go To Index
    Index