SRW.RUN_REPORT
built-in procedureThis procedure synchronously executes the specified report within the context of the currently running report..
SRW.RUN_REPORT (command_line CHAR);
Parameters |
Description |
|
Includes command line keywords valid for In Oracle Reports 10g Release 2 (10.1.2), the use of keywords
|
SRW.RUN_REPORT ("report=test.rdf ... ")
Suppose you have the following two reports:
MGR_RUN, which queries manager names, and invokes a second report named MAIL_IT.
MAIL_IT, which queries employee names for the manager that MGR_RUN passes it, and sends the report output to the manager through e-mail.
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.)
About the
Reports Builder built-in package (SRW
)
Copyright © 1984, 2005, Oracle. All rights reserved.