Dynamic Format Values Limitations with Using Distribution

Using Event-Driven Publishing 21-3

21.1.2.2 Remove_Parameter

Use REMOVE_PARAMETER to remove a parameter from a parameter list. Call the procedure, and pass the parameter list from which you want to remove a parameter along with the name of the parameter you want to remove. For example: DECLARE myPlist SRW_PARAMLIST; BEGIN myPlist := SRW_PARAMLISTSRW_PARAMETER,; srw.add_parametermyPlist,myParameter,myValue; srw.remove_parametermyPlist,myParameter; END;

21.1.2.3 Clear_Parameter_List

To remove ALL parameters from your list, use CLEAR_PARAMETER_LIST. For example: DECLARE myPlist SRW_PARAMLIST; BEGIN myPlist := SRW_PARAMLISTSRW_PARAMETER,; srw.add_parametermyPlist,myParameter,myValue; srw.clear_parameter_listmyPlist; END; This will remove all parameters from your list.

21.1.3 Including non-ASCII Characters in Parameter Names and Values

To use non-ASCII characters in user parameter names and values when using the Event-Driven Publishing API, you must include in your parameter list a parameter called DEFAULTCHARSET, with its value set to a valid character set name. This character set name can be specified with either the databases NLS_CHARACTERSET for example, JA16SJIS or IANA-defined character set name for example, WINDOWS-31J. You must also ensure that the value of the DEFAULTCHARSET parameter matches the defaultcharset parameter specified in the rwservlet.properties file. Oracle Reports Services encodes non-ASCII user parameter names and values using the character set specified by DEFAULTCHARSET, allowing you to use the Event-Driven Publishing API for reports with non-ASCII characters in parameter names and values.

21.1.4 Submitting a Job

A parameter list contains all vital parameters for submitting a job. The job type determines which parameters are required on the list to enable the Reports Server to process the request. The listed parameters are the same ones that you must specify when you submit a job from a browser to Oracle Reports Servlet rwservlet. In such a case, if the job is a report you will need at least the following parameters but may have more: Note: If you do not add a parameter called DEFAULTCHARSET to your parameter list, Oracle Reports Services encodes your user parameter names and values using the databases NLS_CHARACTERSET. 21-4 Publishing Reports to the Web with Oracle Reports Services ■ GATEWAY provides the URL to Oracle Reports Servlet rwservlet you will use to process the request. ■ SERVER identifies the Reports Server to be used in conjunction with Oracle Reports Servlet rwservlet. ■ REPORT identifies the report file to be run. ■ USERID identifies the name and user ID of the person running the report. ■ AUTHID provides authorization information in the event you are running against a secured server. Each request returns a job_ident record that holds the information required to identify the job uniquely. This information is stored in variable of type SRW.JOB_IDENT. Be aware that this is a PACKAGE-TYPE and must be referenced SRW.JOB_IDENT; while the parameter list is an OBJECT-TYPE and must be referenced SRW_PARAMLIST. For example: DECLARE myPlist SRW_PARAMLIST; myIdent SRW.Job_Ident; BEGIN myPlist := SRW_PARAMLISTSRW_PARAMETER,; srw.add_parametermyPlist,GATEWAY,http:…; srw.add_parametermyPlist,SERVER,mySVR; srw.add_parametermyPlist,REPORT,myReport.RDF; srw.add_parametermyPlist,USERID,mesecret; myIdent := srw.run_reportmyPlist; END; The API method RUN_REPORT takes a parameter list that contains all vital information as input through ADD_PARAMETER, creates and submits the request, and returns the job_ident record. The job_ident record contains the following parameters: ■ MyIdent.GatewayURL ■ MyIdent.ServerName ■ MyIdent.JobID ■ MyIdent.AuthID These parameters are needed by the SRW.REPORT_STATUS function to get status information for a submitted job.

21.1.5 Checking for Status

The Event-Driven Publishing API provides a two-way communication with the Reports Server. You submit a job to the server, and you can query the status of this job from the server using the SRW.REPORT_STATUS function. This function will return a record of type SRW.STATUS_RECORD that holds the same information you would see in the job status display if you were using the executing the rwservlet Web command showjobs. For example: DECLARE myPlist SRW_PARAMLIST; myIdent SRW.Job_Ident; myStatus SRW.Status_Record; Using Event-Driven Publishing 21-5 BEGIN myPlist := SRW_PARAMLISTSRW_PARAMETER,; srw.add_parametermyPlist,GATEWAY,http:…; srw.add_parametermyPlist,SERVER,mySVR; srw.add_parametermyPlist,REPORT,MyReport.RDF; srw.add_parametermyPlist,USERID,mesecret; myIdent := srw.run_reportmyPlist; myStatus := srw.report_statusmyIdent; END; You can use the returned status record for fetching information about the status of your job.

21.1.6 Using the Servers Status Record

The status record contains processing information about your job. It contains the same information found in the server queue showjobs. Additionally, it contains information about the files produced for finished jobs and the lineage for scheduled jobs. The most important information in the status record is the current job status and the status text, used in turn to check for runtime errors and their causes. You can use timing information to determine if a job is subject to cancellation because it has exceeded its predicted time for completion. One way to use the status record is to cancel a job. The Event-Driven Publishing API offers a method for cancelling a job that has been submitted to the server. This might