Creating Group Hierarchies Within Each Data Source

22-14 Publishing Reports to the Web with Oracle Reports Services DEFINITION built-in procedure. Refer to Section 22.4.1, Applying an XML Report Definition at Runtime for more information. ■ You can run an XML report definition by itself without another report by specifying the REPORT or MODULE command line keyword. Refer to Section 22.4.2, Running an XML Report Definition by Itself for more information. ■ You can use rwconverter to make batch modifications using the CUSTOMIZE command line keyword. Refer to Section 22.4.3, Performing Batch Modifications for more information. The following sections describe each of the cases in more detail and provide examples.

22.4.1 Applying an XML Report Definition at Runtime

To apply an XML report definition to an RDF or XML file at runtime, you can use the CUSTOMIZE command line keyword or the SRW.APPLY_DEFINITION built-in procedure. CUSTOMIZE can be used with rwclient, rwrun, rwbuilder, rwconverter, and URL report requests.

22.4.1.1 Applying One XML Report Definition

The following command line sends a job request to Oracle Reports Services and applies an XML report definition, emp.xml, to an RDF file, emp.rdf. In this example, the CUSTOMIZE keyword refers to a file located in a Windows directory path. For UNIX, specify the path according to UNIX standards that is, myreportsemp.xml. rwclient REPORT=emp.rdf CUSTOMIZE=\myreports\emp.xml USERID=usernamepasswordmy_db DESTYPE=file DESNAME=emp.pdf DESFORMAT=PDF SERVER=server_name When you use rwrun, the Reports Runtime command, the equivalent command line would be: rwrun USERID=usernamepasswordmy_db REPORT=emp.rdf CUSTOMIZE=\myreports\emp.xml DESTYPE=file DESNAME=emp.pdf DESFORMAT=PDF

22.4.1.2 Applying Multiple XML Report Definitions

You can apply multiple XML report definitions to a report at runtime by providing a list with the CUSTOMIZE command line keyword. The following command line sends a job request to Oracle Reports Services that applies two XML report definitions, EMP0.XML and EMP1.XML, to an RDF file, EMP.RDF: rwclient REPORT=emp.rdf CUSTOMIZE=d:\corp\myreports\emp0.xml,d:\corp\myreports\emp1.xml USERID=usernamepasswordmy_db DESTYPE=file DESNAME=emp.pdf DESFORMAT=PDF SERVER=server_name Note: Oracle Reports does not support XML customizations of REP files. Note: Refer to Section 22.4.3, Performing Batch Modifications for more information about using CUSTOMIZE with rwconverter. Customizing Reports with XML 22-15 If you were using Reports Runtime, then the equivalent command line would be: rwrun REPORT=emp.rdf CUSTOMIZE=D:\CORP\MYREPOORTS\EMP0.XML,D:\CORP\MYREPORTS\EMP1.XML USERID=usernamepasswordmy_db DESTYPE=file DESNAME=emp.pdf DESFORMAT=PDF

22.4.1.3 Applying an XML Report Definition in PLSQL

To apply an XML report definition to an RDF file in PLSQL, use the SRW.APPLY_ DEFINITION and SRW.ADD_DEFINITION built-in procedures in the Before Parameter Form or After Parameter Form trigger. The following sections provide examples of these built-in procedures.

22.4.1.3.1 Applying an XML Definition Stored in a File To apply XML that is stored in the

file system to a report, use the SRW.APPLY_DEFINITION built-in procedure in the Before Parameter Form or After Parameter Form triggers of the report. On Windows: SRW.APPLY_DEFINITION ORACLE_HOME\TOOLS\DOC\US\RBBR\COND.XML; On UNIX: SRW.APPLY_DEFINITION ORACLE_HOMETOOLSDOCUSRBBRCOND.XML; When the report is run, the trigger executes and the specified XML file is applied to the report.

22.4.1.3.2 Applying an XML Definition Stored in Memory To create an XML report definition

in memory, you must add the definition to the document buffer using SRW.ADD_ DEFINITION before applying it using the SRW.APPLY_DEFINITION built-in procedure. The following example illustrates how to build up and apply several definitions in memory based upon parameter values entered by the user. The PLSQL in this example is used in the After Parameter Form trigger of a report called videosales_ custom.rdf. The videosales_custom.rdf file contains PLSQL in its After Parameter Form trigger that does the following: ■ Conditionally highlights fields based upon parameter values entered by the user at runtime. ■ Changes number format masks based upon parameter values entered by the user at runtime. Note: In this example, the CUSTOMIZE value demonstrates a directory path to files stored on a Windows platform. For UNIX, use that platforms standard for specifying directory paths that is, forward slashes instead of backward. Note: For a description of the SRW built-in package, including the SRW.APPLY_DEFINITION and SRW.ADD_DEFINITION built-in procedures, and more information about report triggers, see the Oracle Reports online Help.