Create a data model manually for the Parameter Form

Building a Simple Parameter Form for a JSP-based Web Report 42-7

42.3.3 Run the Parameter Form report to the Web

Now that we have modified and examined our Web source, let us view the Parameter Form in a Web browser.

1. Click the Run Web Layout button in the toolbar.

2. The Parameter Form displays in your Web browser, and should look like the

following: Figure 42–5 Parameter form with values

3. Click the Department list and notice how the list is now populated with

department names. Although you can click Run Report, nothing will happen because we have not yet defined an action for it.

42.4 Set up the Target Report

Now that you have set up the parameters, the next step is to set up the target report to accept the parameters. Then, we will define the action for your Parameter Form. When a user clicks Run Report, the target report will be run based on the Department and User ID parameters. The target report we use in this section is the sample report for the Oracle Reports Tutorial. If you completed the exercises in the Oracle Reports Tutorial and created emprevb.jsp, you can use that report in this section. Otherwise, you can use the example file we have provided, called emprev_final.jsp. We will not show the steps to build this report in this section. Note: 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: BrowserName=Netscape 7; BrowserPath=C:\Program Files\Netscape\Netscape\Netscp.exe. Note: In the modified Parameter Form, notice how the list of values for the Department has changed from a to Accounting. 42-8 Oracle Reports Users Guide to Building Reports For more information on building the sample JSP-based Web report, refer to the Oracle Reports Tutorial. To set up the target report: 1. In Reports Builder, open the file we have provided called emprev_final.jsp. 2. In the Object Navigator, double-click the icon next to the Data Model node.

3. In the Data Model view that displays, double-click the query Q_1 to display the

SQL Query Statement dialog box. 4. Find the final line of the code: WHERE EMPLOYEES.MANAGER_ID = EMPLOYEES_A1.EMPLOYEE_ID AND EMPLOYEES.DEPARTMENT_ID = 100 5. Change the second WHERE clause so that the last line looks like this: WHERE EMPLOYEES.MANAGER_ID = EMPLOYEES_A1.EMPLOYEE_ID AND EMPLOYEES.DEPARTMENT_ID = :P_DEPARTMENT

6. Click OK.

7. A note displays that indicates a bind parameter has been created. Click OK.

8. Save your report as emprev_param_your_initials.jsp.

42.5 Deploy the JSP Parameter Form and the Target Report

To deploy the JSP Parameter Form and the target JSP-based Web report, you must copy paramform_your_initials.jsp and emprev_final_your_ initials .jsp to the deployment directory of your Application Server. For testing purposes, however, you can use the Oracle WebLogic Server instance shipped with the Oracle Developer Suite. Once you have placed the target report in the desired directory, you can then modify the Parameter Form to point to the report location. For more information on deploying a JSP-based Web report, refer to the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual. To set up and deploy the JSP Parameter Form and the target report: 1. Copy the JSP Parameter Form and the Web report paramform_your_ initials .jsp and emprev_param_your_initials.jsp into the following directory: BEA_HOME\servers\WLS_REPORTS\stage\reports\reports\web.war 2. In Reports Builder, open the file: BEA_HOME\servers\WLS_ REPORTS\stage\reports\reports\web.war\paramform_your_ initials .jsp. Tip: The code we have changed is in bold text. Note: BEA_HOME is the directory in which Reports Builder is installed.