Oracle9iAS Reports Services Publishing Reports to the Web Release 9.0 Part Number A92102-01 |
|
This chapter discusses various ways to send report requests to the Reports Server. It includes the following sections:
This section provides quick reference information on formulating a URL for publishing a report. It covers three deployment types:
The information is largely the same for both Windows and UNIX environments. Differences are noted.
The syntax for the URL of a report run via the Reports Servlet is:
http://<web_server>.<domain_name>:<port>/<alias>/rwservlet?<parameters>
Table 8-1 lists and describes the components of the servlet URL.
The URL that calls the Reports Servlet could look like this:
http://neptune.world.com:80/reports/rwservlet?keyname
Keyname refers to a command line listed under a unique header (the key name) in the cgicmd.dat file. Note that this works differently for JSP files, which use the keyword/value pair cmdkey=
value
to specify key names for command lines that are stored in the cgicmd.dat file. You'll find more information about using key mapping in Section 8.9, "Using a Key Map File".
Using the servlet does not mean that you cannot also use Reports JSP files, if the JSP files contain both Web and paper layouts. When you run the report, specify the servlet in the URL and call the JSP with the command line argument: report=<
myreport>.jsp
.
For example:
http://neptune.world.com:80/reports/rwservlet?report=myreport.jsp&destype=cache&desformat=html
You'll find more information about command lines in Appendix A, "Command Line Arguments".
The syntax for a JSP-based report URL is:
http://<web_server>.<domain_name>:<port>/<alias>/myreport.jsp?<parameters>
Table 8-2 lists and describes the components of the JSP-based report URL.
The URL used to invoke a JSP-based report could look like this:
http://neptune.world.com:80/jsp/myreport.jsp?
You can specify a key in the URL that refers to a command line in the cgicmd.dat file that contains additional command line parameters. In this case, you must use the name value pair: cmdkey=
keyname
. This can appear anywhere in your URL, provided it follows the start of the query string (marked by a question mark). For example:
http://neptune.world.com:80/jsp/myreport.jsp?userid=scott/tiger@hrdb&cmdkey=key1
In your URL, use an ampersand (&) with no spaces to string parameters together.
Using a JSP does not mean that you cannot also use the Reports Servlet. When you run the report, specify the servlet in the URL and call the JSP with the command line argument: report=<
myreport>.jsp
.
For example:
http://neptune.world.com:80/reports/rwservlet?report=myreport.jsp&destype=cache&desformat=html
You'll find more information about command line keywords in Appendix A, "Command Line Arguments". You'll find more information about the cgicmd.dat file in Section 8.9, "Using a Key Map File". For information on choosing whether to use the Reports Servlet to run JSP reports, refer to Chapter 1, "Oracle9iAS Reports Services Architecture".
The syntax for the URL of a report run via the Reports CGI on Windows is:
http://<web_server>.<domain_name>:<port>/<alias>/rwcgi.exe?<parameters>
And on UNIX is:
http://<web_server>.<domain_name>:<port>/<alias>/rwcgi.sh?<parameters>
Table 8-3 lists and describes the components of a CGI-based report URL.
The URL used to invoke a CGI implementation could look like this on Windows:
http://neptune.world.com:80/CGI-BIN/rwcgi.exe?key2
And like this on UNIX:
http://neptune.world.com:80/CGI-BIN/rwcgi.sh?key2
If Reports Services is installed on a UNIX machine, use ".sh" in lieu of ".exe". For example:
http://neptune.world.com:80/CGI-BIN/rwcgi/sh?key2
There are a number of request methods available to you for running your report requests. These include:
The rwclient
command line (rwclient.sh
on UNIX) is available for running report requests from a command line in a non-Web architecture. It references an executable file that parses and transfers the command line to the specified Oracle9iAS Reports Server. It can use command line arguments similar to those used with the Oracle9iAS Reports Runtime executable file, rwrun (rwrun.sh on UNIX).
On Windows, a typical rwclient
command line request looks like this:
rwclient report=<my_report>.rdf userid=<username>/<password>@<my_db> server=<server_name> destype=html desformat=cache
On UNIX, the same command would look like this:
rwclient.sh report=<my_report>.rdf userid=<username>/<password>@<my_db> server=<server_name> destype=html desformat=cache
See Appendix A, "Command Line Arguments" for more information about command line arguments.
To run a report from a browser, use the URL syntax.The Oracle9iAS Reports Servlet (and CGI, for backward compatibility) converts the URL syntax into an rwclient
command line request that is processed by Oracle9iAS Reports Services. You can give your users the URL syntax needed to make the report request from their browser, or you can add the URL syntax to a Web site as a hyperlink. The remainder of this chapter discusses this method in more detail.
The Oracle9iAS Portal component enables you to add a link to a report in an Oracle9iAS Portal page or portlet, or to output report results directly into a portlet. Each report link points to a packaged procedure that contains information about the report request. Oracle9iAS Reports Services system administrators use Oracle9iAS Portal wizards to create the packaged procedure making it more convenient and secure to publish the report via the Web. Authorized users accessing the Oracle9iAS Portal page group simply click the link to run the report. System administrators can run the report directly from the wizard. See the Oracle9iAS Portal online help for more information.
Refer to Publishing a Report Portlet in Oracle9iAS Portal for more information about how to publish your report as a portlet.
SRW.RUN_REPORT is a built-in that runs an Oracle9iAS Reports Runtime command. When you specify SRW.RUN_REPORT, set the SERVER argument to the Oracle9iAS Reports Services server name to cause the SRW.RUN_REPORT command to behave as though you executed an rwclient
command.
Refer to the Oracle9i Developer Suite (Oracle9iDS) Reports Builder online help for more information.
One of the best ways to publish your reports is through the declarative, secure interface of Oracle9iAS Portal. To a expose a report in a portal, you must do the following:
If you do not already have a provider defined to contain your reports, you need to create one. For more information on creating a provider, see the Oracle9iAS Portal online help.
Note: The provider that contains your reports must be a database provider and must have the Expose as Provider setting selected on its Access page. |
To make your report available as a portlet, you must do the following:
Note: If you need to create report definition file access for a number of reports, it may be more efficient to batch register them. For more information, see Appendix C, "Batch Registering Reports in Oracle9iAS Portal". |
Once the portlet for your report is in the Portlet Repository, you may add it to any page just as you would any other portlet.
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:
http://<your_webserver>.<domain_name>:<port>/<alias>/rwservlet? report=myreport.rdf&USERID=<username>/<password>@<my_db> &SERVER=<server_name>&DESFORMAT=html&DESTYPE=cache
If you require additional command line arguments, then refer to Appendix A, "Command Line Arguments" for a list of valid rwclient
command line arguments.
http://<your_webserver>.<domain_name>:<port>/<alias>/rwservlet?key1
To add the URL syntax to a Web page as a hyperlink:
HREF
tag on the host Web page, for example:
<A HREF="http://<web_server>.<domain_name>:<port>/<alias>/rwservlet?key1> Employee Directory</A>
If you have activated the Reports Server's URL engine, you can send job requests to the URL engine by using the following command line arguments:
Note: For information on activating the URL engine, refer to Chapter 3, "Configuring Oracle9iAS Reports Services". |
For example, a request that specifies an external URL for urlParameter might look like the following:
http://localhost.com/servlet/RWServlet?server=ReportsServer +jobType=urlEngine+urlParameter="http://www.oracle.com" +destype=mail+desname=foo@bar.com+desformat=htmlcss
Alternatively, a request that specifies a JSP report for urlParameter would look like the following:
http://<localhost>/servlet/RWServlet?server=ReportsServer+jobType=rwurl +destype=cache+urlParameter="http%3A%2F%2F<localhost>%2Ffoo.jsp%3Fuserid %3Dscott%2Ftiger@v815%3Fserver%3DreportsServer
Note: If the URL has special characters, they must be encoded as per the x-www-form-urlencoded format. |
You can use the server to run reports automatically from the Oracle9iAS Reports Queue Manager, Oracle9iAS Portal, or with the SCHEDULE
command line argument. The scheduling feature enables you to specify a time and frequency for the report to run.
Refer to the Oracle9iAS Reports Queue Manager online help for more information about scheduling your reports.
If you publish a report as a Portal component on an Oracle9iAS Portal page, then you can schedule the report request to run automatically and push the resulting reports to specified pages. Refer to Oracle9iAS Portal online help for more information.
The SCHEDULE
keyword is available for use with the rwclient, rwservlet, and rwcgi commands. See Appendix A, Section A.4.83, "SCHEDULE" for more information.
When you send a request to the Reports Server, the following additional parameters, the values of which you cannot change, are implicitly passed along with your request:
When you run a report, a copy of the report output is saved in the Oracle9iAS Reports Services cache. Subsequently, if an identical report is run (that is, with the same cache key), then the current request is recognized as a duplicate job.
There are several scenarios where Reports caching takes effect:
The job cache key excludes the destype, desname, server, and tolerance parameters, and includes almost all other parameters.
This level of cache happens automatically. You don't need to specify any other parameters in the command line for it to work.
tolerance=
n
(where n
is a number in units of minutes) in the new job request "A", and it doesn't happen, then the Reports Server will try to find a job in the Finished Jobs Queue which was successfully completed within n
minutes. If the Reports Server can find such a job, then the new job request "A" will return the output of job "B".
Refer to Appendix A, "Command Line Arguments" for more information about the TOLERANCE command line argument.
Note:
Oracle9iAS Reports Services cache results are persistent. If the Reports Server is shut down, once it is up again all the previous cache results are recovered and ready to use again.
For more information on setting the cache, refer to the Oracle9iAS Reports Queue Manager online help, and see Chapter 3, "Configuring Oracle9iAS Reports Services".
job_2
, which has the same cache key as job _1
. Oracle9iAS Reports Services uses the output from job_1
for job_2
. In this case, processing job_2
is significantly faster since job_2
is fetched from cache rather than run in its own right.
If you choose to provide users with a URL or add a hyperlink to a Web site, then you can use a key map file to simplify or hide parameters in your URL requests.
The key map file contains command strings for running reports, each headed by a unique key identifier. Except when you run a report as a JSP, you reference only this key in the runtime URL. The server or servlet sends the key value to the map file (cgicmd.dat), which in turn returns the command associated with the specified key to the server or servlet for processing. By using key mapping, the command line arguments are all hidden from the user.
Key mapping is useful for:
When you specify a key name from the key map file (cgicmd.dat), it must always be at the beginning of the query string (after the question mark) in a report request URL. An exception to this is if you use the cmdkey command line keyword, and express the key name as its value: cmdkey=
keyname
. In this case, you can place the key name anywhere in the query string within the report request URL. The cmdkey
keyword can be used with jobs run as JSPs and with the rwservlet
command.
Note:
You'll find more information about the |
Key mapping is enabled when any of these conditions are met:
ORACLE_HOME
\reports\conf\
directory on the Web server machine (on either Windows or UNIX).
rwcgi
is used, when the REPORTS_CGIMAP environment variable on the Web server machine specifies the name of a valid key map file. See Appendix B, "Reports-Related Environment Variables" for more information.
rwcgi
URLs, the first argument (that is the first information after the question mark) is treated as a key if it is not otherwise a part of a name/value pair. If the first argument is a name/value pair (i.e., keyword=value), then the whole command line is used in lieu of a cgicmd.dat key entry.
To add key mapping entries to a key map file:
You'll find this file in the following directory on both Windows and UNIX:
ORACLE_HOME\reports\server\conf\cgicmd.dat
key1: report=<your_report.rdf> USERID=<username>/<password>@<my_db> DESFORMAT=html SERVER=<server_name>.<cluster_name (if present)> DESTYPE=cache
In this example, key1 is the name of the key.
Except for the special parameters that are described in the file itself, the command line arguments follow the syntax rules of rwclient
. See Appendix A, "Command Line Arguments" for more information.
For more information, see Section 8.4, "Specifying a Report Request from a Web Browser".
When you place a key name in a report request URL, it must always be the first value within the query string (immediately after the question mark). For example:
http://.../rwservlet?keyname
Below is an example of a key mapping for a restricted run with a parameter form.
The URL might be:
http://<web_server>.<domain_name>:<port>/CGI-BIN/rwcgi.exe?key&par1&par2&parN
The key mapping file might contain:
KEY: REPORT=<myreport> DEPTNO=%1 MYPARAM=%2 %*
This would generate the equivalent of the following command line request:
rwclient REPORT=<myreport> DEPTNO=par1 MYPARAM=par2 parN
When you run a report as a JSP and want to call a command key in the cgicmd.dat file, you must use the cmdkey
keyword in your URL. For example, your JSP URL might look like this:
http://.../myreport.jsp?cmdkey=key
When you use cmdkey with a JSP or rwservlet
, you can place it anywhere within the query string. For example:
http://.../example.jsp?parameter1=value1&cmdkey=keyname http://.../rwservlet?parameter1=value1&cmdkey=keyname
|
Copyright © 2002 Oracle Corporation. All Rights Reserved. |
|