A script-enabled browser is required for this page to function properly.

SRW.RUN_REPORT built-in procedure

This procedure synchronously executes the specified report within the context of the currently running report..

Syntax

SRW.RUN_REPORT (command_line CHAR);

Parameters

Description

command_line

Includes command line keywords valid for rwrun, enclosed in quotes. 

In Oracle Reports 10g Release 2 (10.1.2), the use of keywords SERVER and USERID with SRW.RUN_REPORT is deprecated. If you have reports created in prior releases that use these keywords with SRW.RUN_REPORT, you can set environment variable REPORTS_SRWRUN_TO_SERVER=YES to run these reports with Oracle Reports 10g Release 2 (10.1.2).

Examples

Example 1

SRW.RUN_REPORT ("report=test.rdf ... ")

Example 2

Suppose you have the following two reports:

The description of MGR_RUN could be as follows:

Query:

SELECT ENAME, EMPNO FROM EMP WHERE JOB="MANAGER"

Group Filter:

FUNCTION FOO RETURN BOOLEAN IS 
BEGIN
  SRW.RUN_REPORT("report=MAIL_IT desname="||:ename ||" desformat=dflt batch=yes
    mgr_no="|| TO_CHAR(:empno)"  " );
  RETURN (TRUE); 
  EXCEPTION 
  when SRW.RUN_REPORT_FAILURE then
    SRW.MESSAGE(30, "Error mailing reports.");
  raise SRW.PROGRAM_ABORT; 
END; 

This PL/SQL invokes MAIL_IT, specifies that MAIL_IT's output should be sent to the manager through e-mail, and passes the manager number, so that the MAIL_IT report can query only the manager's employees.

Note: The empno values must be converted to characters (TO_CHAR in the PL/SQL above), because SRW.RUN_REPORT requires a character string.

Layout: None is needed, because this report only fetches data, then passes it to a second report.

The description of MAIL_IT could be as follows:

Query:

SELECT DEPTNO, ENAME, SAL FROM EMP WHERE MGR=:MGR_NO 

Layout: Master/Detail

Suppose that you have three reports that you almost always run together. The reports are named SALARY, COMMISS, and TAXES. To run these reports with one command, you create a driver report named PAYROLL. The description of PAYROLL could be as follows:

Query:

SELECT DEPTNO FROM DEPT 

Before Report Trigger:

FUNCTION FOO RETURN BOOLEAN IS 
BEGIN
  SRW.RUN_REPORT("batch=yes report=SALARY destype=file desformat=dflt desname=salary.lis")
  SRW.RUN_REPORT("batch=yes report=COMMISS destype=file desformat=dflt desname=comiss.lis"); 
  SRW.RUN_REPORT("batch=yes report=TAXES destype=file desformat=dflt desname=comiss.lis");
  RETURN (TRUE); 
END; 

Layout: Tabular

When you run PAYROLL from Reports Builder or rwrun, the other three reports will all be run. (Note that, in this case, the query and the layout for PAYROLL could be anything. They are only used here in order to make it possible to run PAYROLL.)

See also

About the Reports Builder built-in package (SRW)

SRW built-in package