Deploying a JSP Report to the Web and to Paper

18-10 Publishing Reports to the Web with Oracle Reports Services

18.5 Specifying a Report Request from a Web Browser

You can provide the user with the URL syntax needed to make a report request, or you can add the URL syntax to a Web page as a hyperlink. URL syntax can be presented in the following forms: ■ Full URL request, for example: http:your_webserver.domain_ name:portaliasrwservlet?report=myreport.rdfuserid= usernamepasswordmy_dbserver=server_namedesformat=htmldestype=cache If you require additional command line keywords, then refer to Appendix A, Command-Line Keywords for a list of valid rwservlet command line keywords. ■ Simplified URL request using key mapping, for example: http:your_webserver.domain_name:portaliasrwservlet?key1

18.6 Sending a Request to the URL Engine

If you have activated the Reports Servers URL engine, you can send job requests to the URL engine by using the following command line options: ■ urlParameter identifies the URL to be placed in the cache. For example, http:www.oracle.com or a JSP report. ■ jobType is the name of a job type for example, rwurl in the server configuration file that is associated with a URL engine. For example, a request that specifies an external URL for urlParameter might look like the following: http:your_webserver:portnumreportsrwservlet?server= ReportsServer+jobType=rwurl+urlParameter= http:www.oracle.com+destype=mail+desname=foobar.com+desformat=htmlcss Alternatively, a request that specifies a JSP report for urlParameter would look like the following: Note: When you use features like Oracle Portal Security, Portal Destination, and Job Status Repository, the JDBC database connections made by Oracle Reports Services may override the initial NLS_LANG setting. This change may in turn affect the behavior of the running report, such as bidirectional output in PDF. On UNIX platforms, you can work around this issue using the environment switching functionality to dynamically set the environment for reports. Refer to Section 8.2.2, Dynamic Environment Switching for more information. Note: For information on activating the URL engine, refer to Section 8.6, Configuring the URL Engine . Running Report Requests 18-11 http:your_webserver:portnumreportsrwservlet?server= ReportsServer+jobType=rwurl+destype=cache+urlParameter= http3A2F2Flocalhost2Ffoo.jsp3Fuserid3Dscott2FtigeroraDB3Fserver3Dreport sServer

18.7 Running Reports Through a Web Service

In many cases, reports are integrated components of some larger application rather than a standalone application themselves. Hence, it can be useful to generate report requests from within an application. We accomplish this goal by exposing Oracle Reports Services as a Web service. This Web service may then be called from within any Web service-aware environment for example, a Java application. For example, suppose that you have a Java-based expense reporting form and you want to allow users to generate a PDF version of their expense reports from it each time that they complete an expense form in your system. By creating a Java proxy Oracle Reports Web Service, you could then easily reference it from your Java development environment for example, Oracle JDeveloper and add a button that invokes Oracle Reports Services to generate the PDF file.

18.8 Calling Oracle Reports from Oracle Forms Services

The tight product integration between Oracle Reports and Oracle Forms Services enables you to pass blocks of data between the two products and removes the need for subsequent queries. This technique, referred to as query partitioning, ensures that Oracle Reports is responsible for formatting data and ignores dynamic alteration of queries through triggers and lexical parameters. Oracle Forms Services uses the shared Java Virtual Machine JVM controller for all report requests, reducing memory consumption. A typical integration between Oracle Forms Services and Oracle Reports is an application that provides a form to fill in data, which is used to generate a report. The steps that occur during this process are similar to the following example: ■ The end user enters values in a form. Some or all of these values are parameter inputs to the associated report. ■ The end user clicks a button, which generates the report as follows: – Oracle Forms Services populates all the parameters to execute the report. – Oracle Forms Services calls the RUN_REPORT_OBJECT built-in to send a request to Oracle Reports. Note: If the URL has special characters, they must be encoded as per the x-www-form-urlencoded format. See Also: Chapter 19, Using the Oracle Reports Web Service for more information on the Oracle Reports Web service and installing and using the sample proxy and Java client. Note: Unless data parameters are unreasonably large or the queries particularly complicated, the perceived performance improvements should be negligible. Additionally, only top level groups in a report can accept data parameters passed from forms. 18-12 Publishing Reports to the Web with Oracle Reports Services – Oracle Reports returns the job id, and Oracle Forms Services queries on the status of this job id. – When the job status is FINISHED, Oracle Forms Services calls the WEB.SHOW_ DOCUMENT built-in to submit a request to open the report output. – The WEB.SHOW_DOCUMENT built-in opens the following URL in the browser: http:host:portreportsrwservletgetjobidn?server=server_name For additional information on calling a report from an Oracle Forms Services application, refer to the Integrating Oracle Reports Services 11g in Oracle Forms Services 11g white paper on OTN http:www.oracle.comtechnologyproductsformstechlisti ng10g.html .

18.8.1 Communication Between Reports and Forms Installed on Different Instances

Oracle Reports 11g Release 1 11.1.1 communicates with Forms. If Forms and Reports are configured on different Oracle Instances, you must complete the following steps in Forms to facilitate communication with Reports Servers. FORMS_ORACLE_INSTANCE refers to the Oracle Instance where Forms is configured.

1. From your present working directory, run the following command:

cd FORMS_ORACLE_INSTANCEconfig

2. Create the ReportsTools directory as follows:

mkdir -p ReportsToolsComponentReportsTools

3. Copy the tools-logging.xml file as follows:

cp ORACLE_HOMEreportsconfReportsToolstools-logging.xml FORMS_ORACLE_ INSTANCEconfigReportsToolsComponentReportsToolslogging.xm l

4. Copy the tools-log-template.xml file as follows:

cp ORACLE_ HOMEreportsconfReportsToolstools-log-template.xml FORMS_ ORACLE_ INSTANCEconfigReportsToolsComponentReportsToolscomponent- logs.xml

5. Copy the rwnetwork.conf file as follows:

cp ORACLE_HOMEreportsconfrwnetwork.conf FORMS_ORACLE_ INSTANCEconfigReportsToolsComponentReportsToolsrwnetwork. conf

6. Replace the following macros in the copied files:

■ Instance.directory with FORMS_ORACLE_INSTANCE ■ Self.component_type with ReportsToolsComponent ■ Self.name with ReportsTools Note: For secure mode, the URL will also include authid=authid