01.02.2013 Views

Publishing Reports to the Web - Downloads - Oracle

Publishing Reports to the Web - Downloads - Oracle

Publishing Reports to the Web - Downloads - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The Event-Driven <strong>Publishing</strong> API<br />

Each request returns a job_ident record that holds <strong>the</strong> information required <strong>to</strong> identify<br />

<strong>the</strong> job uniquely. This information is s<strong>to</strong>red in variable of type SRW.JOB_IDENT. Be<br />

aware that this is a PACKAGE-TYPE and must be referenced SRW.JOB_IDENT; while<br />

<strong>the</strong> parameter list is an OBJECT-TYPE and must be referenced SRW_PARAMLIST.<br />

For example:<br />

DECLARE<br />

myPlist SRW_PARAMLIST;<br />

myIdent SRW.Job_Ident;<br />

BEGIN<br />

myPlist := SRW_PARAMLIST(SRW_PARAMETER('',''));<br />

srw.add_parameter(myPlist,'GATEWAY','http://…');<br />

srw.add_parameter(myPlist,'SERVER','mySVR');<br />

srw.add_parameter(myPlist,'REPORT','myReport.RDF');<br />

srw.add_parameter(myPlist,'USERID','me/secret');<br />

myIdent := srw.run_report(myPlist);<br />

END;<br />

The API method RUN_REPORT takes a parameter list that contains all vital information<br />

as input (via ADD_PARAMETER), creates and submits <strong>the</strong> request, and returns <strong>the</strong> job_<br />

ident record.<br />

The job_ident record contains <strong>the</strong> following parameters:<br />

■ MyIdent.GatewayURL<br />

■ MyIdent.ServerName<br />

■ MyIdent.JobID<br />

■ MyIdent.AuthID<br />

These parameters are needed by <strong>the</strong> SRW.REPORT_STATUS function <strong>to</strong> get status<br />

information for a submitted job.<br />

17.1.4 How <strong>to</strong> Check for Status<br />

The Event-Driven <strong>Publishing</strong> API provides a two-way communication with <strong>the</strong><br />

<strong>Reports</strong> Server. You submit a job <strong>to</strong> <strong>the</strong> server, and you can query <strong>the</strong> status of this job<br />

from <strong>the</strong> server using <strong>the</strong> SRW.REPORT_STATUS function.<br />

This function will return a record of type SRW.STATUS_RECORD that holds <strong>the</strong> same<br />

information you would see in <strong>the</strong> job-status display if you were using <strong>the</strong> <strong>Reports</strong><br />

Servlet's SHOWJOBS command.<br />

For example:<br />

DECLARE<br />

myPlist SRW_PARAMLIST;<br />

myIdent SRW.Job_Ident;<br />

myStatus SRW.Status_Record;<br />

BEGIN<br />

myPlist := SRW_PARAMLIST(SRW_PARAMETER('',''));<br />

srw.add_parameter(myPlist,'GATEWAY','http://…');<br />

srw.add_parameter(myPlist,'SERVER','mySVR');<br />

srw.add_parameter(myPlist,'REPORT','MyReport.RDF');<br />

srw.add_parameter(myPlist,'USERID','me/secret');<br />

myIdent := srw.run_report(myPlist);<br />

myStatus := srw.report_status(myIdent);<br />

END;<br />

17-4 <strong>Oracle</strong> Application Server <strong>Reports</strong> Services <strong>Publishing</strong> <strong>Reports</strong> <strong>to</strong> <strong>the</strong> <strong>Web</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!