In this chapter, you will learn about JSP-based Web reports that include a simple Parameter Form. To build a Parameter Form for a paper report, refer to the Oracle Reports online Help. By following the steps in this chapter, you can generate the report output shown in Figure 42-1 and Figure 42-2.
Note:The JSP Parameter Form in this image enables the user to choose from a list of departments, connect to a database, then run a report based on the selected parameters.
Note:The JSP-based Web report in this image displays a graph and a tabular report based on the department selected in the JSP Parameter Form. To see how this report was built, refer to the Oracle Reports Tutorial.
In this example, you will build an HTML Parameter Form using JavaServer Pages (JSPs) for a JSP-based Web report. For conceptual information about JSPs and Parameter Forms for Web reports, refer to Section 2.2.1, "About JavaServer Pages (JSPs) and servlets" and Section 1.9.4, "About Parameter Forms for Web reports".
This example shows you how to build a very simple Parameter Form. If this Parameter Form does not suit your needs, refer to a more advanced example on the Oracle Technology Network (OTN): on the Oracle Reports page (
http://www.oracle.com/technology/products/reports/index.html), click Getting Started to display the Getting Started with Oracle Reports home page. In the list of topic sections on the left, click Index. In the Collateral Type list, choose Examples, and click Search. In the list of examples that displays, click Building a JSP-based Web Report with a Parameter Form.
In this example, you have an existing JSP-based Web report that shows a bar graph of employee salaries per department, as well as a tabular report that shows the employee details. Your customers want to see the employee information for a specific department at runtime, so that they do not have to read the data for all departments. The steps in this example show you how to add a JSP Parameter Form to this JSP-based Web report.
This example uses the resulting report from the Oracle Reports Tutorial. If you want to learn how to build the Web report that we use in this example, follow the steps in the tutorial.
As you build this example report, you will:
Create a Parameter Form in HTML using a text or HTML editor.
Modify the HTML Parameter Form in Reports Builder using the Data Model and Web Source views, and save as a JSP.
Set up the Target Report using the Data Model view to modify the query for the target report to accept user parameters.
To see a sample JSP-based Web report that includes a simple Parameter Form, open the examples folder named
simplejsppf, then open
results\emprev_param.jsp. For details on how to open it, see "Accessing the Example Reports" in the Preface. The example files used in this chapter are listed and described in Table 42-1.
An example HTML Parameter Form, which contains an example List of Values, a field, and a button.
This JSP-based Web report contains the modifications to the Parameter Form you will make in Reports Builder.
The source Web report that will become the target report for the Parameter Form.
The final JSP-based Web report with a JSP Parameter Form.
Note:If you completed the exercises in the Oracle Reports Tutorial, you can also use the
.jspfile you created at the end of Chapter 6.