Creating Multiple Data Sources Linking Between Data Sources

Customizing Reports with XML 22-13 ATTLIST parameter name CDATA REQUIRED datatype number|character|date number width CDATA 20 scale CDATA 0 precision CDATA 0 initialValue CDATA IMPLIED inputMask CDATA IMPLIED validationTrigger CDATA IMPLIED label CDATA IMPLIED defaultWidth CDATA IMPLIED defaultHeight CDATA IMPLIED The following example demonstrates a dynamic list of values LOV, an initial value, and a validation trigger. report name=anyname DTDVersion=9.0.2.0.0 data dataSource name=Q_1 defaultGroupName=G_DEPARTMENTS select select from departments select dataSource parameter name=P_LAST_NAME datatype=character precision=10 initialValue=SMITH validationTrigger=p_last_namevalidtrigger defaultWidth=0 defaultHeight=0 listOfValues restrictToList=yes selectStatement hideFirstColumn=yes [CDATA[select last_name, last_name||-||employee_id from employees]] selectStatement listOfValues parameter data programUnits function name=p_last_namevalidtrigger returnType=character textSource [CDATA[function P_LAST_NAMEValidTrigger return boolean is last_name char20; begin select count into last_name from employees where upperlast_name=upper:p_last_name; exception when OTHERS then returnFALSE; end; returnTRUE; end; ]] textSource function programUnits report

22.4 Using XML Files at Runtime

Once you have created your Oracle Reports XML customization file, you can use it in the following ways: ■ You can apply XML report definitions to RDF or other XML files at runtime by specifying the CUSTOMIZE command line keyword or the SRW.APPLY_ 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.