Create a dynamic LOV in the Parameter Form

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. Building a Simple Parameter Form for a JSP-based Web Report 42-9 3. In the Web Source view, modify the action for the form so that when the user clicks Run Report, the emprev_param_your_initials.jsp report executes based on the selected parameters. The code should look like this: form name=form1 method=post action=reportsrwservlet input type=hidden name=report value=reportname.rdf input type=hidden name=destype value=destype input type=hidden name=desformat value=desformat input type=hidden name=userid value=db_connect_string input type=submit name=Submit value=Submit form 4. Save your report. 5. Start your Oracle WebLogic Server instance. ■ On Windows, Go to the following directory ORACLE_HOME\Middleware_HOME\user_projects\domains\your_domain Double-click startWebLogic.cmd Where, your_domain is the domain created by you. ■ On UNIX, start the shell script: ORACLE_HOMEMiddleware_HOMEuser_projectsdomainsyour_ domainstartWebLogic.sh Where, your_domain is the domain created by you. 6. In a Web browser, type the URL for the Parameter Form: http:computer name:portreportsparamform_your_ initials .jsp?userid=useridpassworddatabase name In our example, we would use: http:mycomputer-pc:8888reportsparamform_your_initials.jsp?userid=hrhrorcl Notes: ■ In the above code, the action attribute assumes that the report is located in the directory we specified in the above steps. ■ The Parameter Form developed in this chapter can also be used to execute a paper report instead of a Web report. To do this, use the following code: form name=form1 method=post action=reportsrwservlet?report=report _name .jspdestype=destypedesformat=desformat ■ For more information on deploying JSP-based Web reports and paper reports, refer to the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual. Tip: The Oracle WebLogic Server instance starts once the containers for Java EE have been initialized. 42-10 Oracle Reports Users Guide to Building Reports 7. If the Single Sign-On login page displays, enter your Single Sign-On user name and password. For more information about OracleAS Single Sign-On, see the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual. 8. When the Parameter Form displays, choose a department from the list. For example, choose Finance.

9. In the Login ID field, type the connect string for the database schema that the

emprev_param_your_initials.jsp report uses. For example, hrhrorcl: Figure 42–6 JSP Parameter Form with selections

10. Click Run Report.

11. The employee salary report displays with a graph at the top, and should look like this: Note: The connect string you type in the URL is for the database you used to create the data model in Section 42.3.1, Create a data model manually for the Parameter Form . For the purposes of this example, we have used plain text to pass the connect string. You can find more information about security in the chapter Securing Oracle Reports Services in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual.