Dynamic Environment Switching Reports Server Configuration File

Configuring Oracle Reports Services 8-45 The Arabic report has to be submitted to Reports Server with the following command line: http:machine_name:portreportsrwservlet?SERVER=server_name REPORT=arabic.rdfUSERID=usernamepasswddbDESFORMAT=htmlcss DESTYPE=cacheENVID=AR Since the job is submitted with ENVID=AR, Reports Server finds or starts an engine with the environment specified by element AR in the Reports Server configuration file. The job is processed by the new engine and the output is distributed to the specified destination. Example 3 The following example illustrates how the environment switching feature could be used in conjunction with a JSP report; that is, without Oracle Reports Servlet rwservlet. Suppose that you have the following environment elements in the Reports Server configuration file: environment id=UK envVariable name=NLS_LANG value=AMERICAN_UNITED KINGDOM.WE8ISO8859P1 environment environment id=US envVariable name=NLS_LANG value=AMERICAN_AMERICA.WE8ISO8859P1 environment If your JSP report uses a format mask such as the following, it means the currency, grouping, and decimal symbols can change according to the environment: rw:field id=sal src=sal formatMask=L999G999D999 To run the report using the UK symbols for currency, grouping, and decimal, you would use the following URL: http:myserver:porttestmyjsp?USERID=scotttigerorclENVID=UK Note: You could place ENVID=UK into a key in the cgicmd.dat key map file for more information, see Section 18.13, Using a Key Map File .

8.2.2.2 Usage Notes

■ Although this feature is ideal for handling reports of various languages, its application can be much broader. You could use it in any situation where a report requires a particular environment to execute correctly. ■ Reports Server will start one or more engines per environment id as and when it gets requests for specific environments. The total number of engines, however, cannot exceed the maxEngine specified for that engine type. It is recommended that you set maxEngine to a value greater or equal to the number of environment elements specified in the Reports Server configuration file. ■ defaultEnvId can also be applied to pluggable engines other than rwEng. Reports Server will spawn the pluggable engine with the specified environment id. ■ For engines used by the in-process Reports Server, the order of precedence for environment variables from highest to lowest is as follows: ■ reports.sh UNIX only 8-46 Publishing Reports to the Web with Oracle Reports Services ■ environment element in the Reports Server configuration file ■ Go to the WebLogic Administration Console, navigate to the Server Start tab and specify the oracle.home and oracle.instance parameters. ■ The system settings and registry Windows only ■ For engines used by the standalone server, the order of precedence for environment variables from highest to lowest is as follows: ■ reports.sh UNIX only ■ environment element in the Reports Server configuration file ■ The environment set in the console where you start rwserver.sh ■ The system settings and registry Windows only ■ If the same environment variable that is set in ENVID is also set in reports.sh ORACLE_INSTANCEconfigreportsbinreports.sh, Reports Server obtains the environment variable value from reports.sh and not from ENVID. For example, say you want to set the REPORTS_PATH environment variable to a different engine by using the environment switching feature. However, the reports.sh file also has the same REPORTS_PATH environment variable set. Reports Server will now use only REPORTS_PATH set by reports.sh and not the REPORTS_PATH set in ENVID when you pass any request. To work around this issue, you must: 1. Open reports.sh and comment the environment variable value. For example, comment the REPORTS_PATH value set in the reports.sh file. 2. Open the rwserver.conf file. 3. Copy the environment variable value in the reports.sh file to the rwserver.conf file. For example: environment id=default envVariable name=REPORTS_PATH value=ORACLE_ HOMEreportstemplates:ORACLE_ HOMEreportssamplesdemo:ORACLE_HOMEreportsinteg:ORACLE_ HOMEreportsprinters environment environment id=testenv envVariable name=REPORTS_PATH value=privatefile_path:ORACLE_HOMEreportstemplates:ORACLE_ Note: If you have modified your current reports.sh file, you should save it and, after installing Oracle Reports, merge your modifications into the version of reports.sh installed with the latest version. The latest reports.sh contains some required changes. Note: If you have modified your current reports.sh file, you should save it and, after installing Oracle Reports, merge your modifications into the version of reports.sh installed with the latest version. The latest reports.sh contains some required changes. Configuring Oracle Reports Services 8-47 HOMEreportssamplesdemo:ORACLE_HOMEreportsinteg:ORACLE_HOME reportsprinters environment 4. Add the defaultEnvId value to the appropriate tag in the rwserver.conf file.For example, add the defaultEnvId attribute to the engine element so that the engine starts with the default REPORTS_PATH. engine id=rwEng class=oracle.reports.engine.EngineImpl initEngine=1 maxEngine=1 minEngine=0 engLife=50 maxIdle=30 callbackTimeOut=90000 defaultEnvId=default 5. Now run the report.

8.3 Oracle Reports Servlet Configuration File

The configuration settings for the Oracle Reports Servlet rwservlet component of Oracle Reports Services are stored in the XML file rwservlet.properties, located in the directory specified in Table 8–1 . For Windows, note that rwservlet.properties uses double backslashes \\ instead of single backslashes to specify a directory path. The first slash escapes the second, which would otherwise have another meaning in this file. For example, in a Windows-based rwservlet.properties file, the path: d:\InstanceHome\config\ReportsServerComponent\ServerName\filename.ext becomes: d:\\InstanceHome\\config\\ReportsServerComponent\\ServerName\\filename.ext For UNIX, use that platforms standard for specifying directory paths, for example: InstanceHomeconfigReportsServerComponentServerNamefilename.ext

8.3.1 Oracle Reports Servlet Configuration Elements

The rwservlet.xsd file provides the following data type definitions for configuring rwservlet.properties elements: ■ rwservlet – server – singlesignon – inprocess – reports_servermap – cookie – defaultcharset – webcommandaccess – allowhtmltags – helpurl – imageurl – reloadkeymap – dbauth 8-48 Publishing Reports to the Web with Oracle Reports Services – sysauth – errortemplate – diagtags – cluster – oidconnection – allowauthid – enabledbproxy These elements along with their related attributes and sub-elements are discussed in the following subsections. Note that these are XML elements, and XML is case-sensitive. Additionally, when you add any of these elements to the rwservlet.properties configuration file, you must follow the order of elements as described in rwservlet.xsd.

8.3.1.1 rwservlet

The rwservlet element is defined in rwservlet.xsd as follows: xs:element name=rwservlet xs:complexType xs:sequence xs:element name=server type=xs:string minOccurs=0 maxOccurs=1 xs:element name=singlesignon type=xs:string minOccurs=0 maxOccurs=1 xs:element name=inprocess type=xs:string minOccurs=0 maxOccurs=1 xs:element name=reports_servermap type=xs:string minOccurs=0 maxOccurs=1 xs:element ref=cookie minOccurs=0 maxOccurs=1 xs:element name=defaultcharset type=xs:string minOccurs=0 maxOccurs=1 xs:element ref=webcommandaccess minOccurs=0 maxOccurs=unbounded xs:element name=allowhtmltags type=xs:string minOccurs=0 maxOccurs=1 xs:element name=helpurl type=xs:string minOccurs=0 maxOccurs=1 xs:element name=imageurl type=xs:string minOccurs=0 maxOccurs=1 xs:element name=reloadkeymap type=xs:string minOccurs=0 maxOccurs=1 xs:element name=dbauth type=xs:string minOccurs=0 maxOccurs=1 xs:element name=sysauth type=xs:string minOccurs=0 maxOccurs=1 xs:element name=errortemplate type=xs:string minOccurs=0 maxOccurs=1 xs:element ref=diagtags minOccurs=0 maxOccurs=1 xs:element ref=cluster minOccurs=0 maxOccurs=1 xs:element ref=oidconnection minOccurs=0 maxOccurs=1 xs:element name=allowauthid type=xs:string minOccurs=0 maxOccurs=1 xs:element name=enabledbproxy type=xs:string minOccurs=0 maxOccurs=1 xs:sequence xs:complexType xs:element Example In rwservlet.properties, the rwservlet element may be specified as shown in this example: Configuring Oracle Reports Services 8-49 rwservlet one or more element specifications rwservlet RequiredOptional Required. You can have a maximum of one rwservlet element in a given configuration file. Description The rwservlet element opens and closes the content area of the Oracle Reports Servlet rwservlet configuration file. In terms of the files hierarchy, all the other elements are subordinate to the rwservlet element. The rwservlet element includes the following sub-elements in its definition: ■ server ■ singlesignon ■ inprocess ■ reports_servermap ■ cookie ■ defaultcharset ■ webcommandaccess ■ allowhtmltags ■ helpurl ■ imageurl ■ reloadkeymap ■ dbauth ■ sysauth ■ errortemplate ■ diagtags ■ cluster ■ oidconnection ■ enabledbproxy

8.3.1.1.1 server

The server sub-element of rwservlet is defined in rwservlet.xsd as follows: xs:element name=server type=xs:string minOccurs=0 maxOccurs=1 Example In rwservlet.properties, the server element may be specified as shown in this example: servermyserverserver