Home » Developer & Programmer » Reports & Discoverer » How to pass parameters into report automatically?
How to pass parameters into report automatically? [message #88043] Wed, 23 January 2002 07:28 Go to next message
George
Messages: 68
Registered: April 2001
Member
Hi,

My reports are scheduled to run automatically, but I need to pass parameters into the reports, and the report will email to different user based on the parameters. for example, I need to pass department no into the reports and send the reports to this dept. manager automatically by email.

How can I pass parameters automatically (a fixed set of parameters) and figure out the user the email should send to based on the parameters? if possible can you include a sample code?

Thanks in advance.
Re: How to pass parameters into report automatically? [message #88091 is a reply to message #88043] Wed, 27 February 2002 20:05 Go to previous message
Sethunath
Messages: 15
Registered: February 2002
Junior Member
George,
If your are calling the report from Forms, I have a solution, I hope. see the code below

declare
pl_id ParamList;a_id alert;
alert_button number;
group_id RecordGroup;
query_ok NUMBER; SPACE CHAR(1);
begin
/*commit the changes*/
DO_KEY('Commit_FORM');
group_id := Find_Group( 'PMAST1' );
/*THIS IS A RECORD GROUP CREATED LOCALLY WHICH IS THE SAME QUERY (SHOULD BE) AS THE MASTER QUERY IN REPORTS. YOU CAN PASS N NO OF PARAMETERS BY THIS*/
query_ok := Populate_Group(group_id);
IF query_ok <> 0 THEN
RAISE Form_Trigger_Failure; PAUSE;EXIT_FORM;
END IF;
pl_id := Get_Parameter_List('TMP');
IF NOT Id_Null(pl_id) THEN
Destroy_Parameter_List( pl_id );
END IF;
pl_id := Create_Parameter_List('TMP');
Add_Parameter(pl_id,'PMAST1',DATA_PARAMETER,'PMAST1');
Add_Parameter(pl_id, 'PARAMFORM', TEXT_PARAMETER, 'NO');
Run_Product(REPORTS, 'C:ACCOUNTSREPORTSPURCHASE_ORDER',
SYNCHRONOUS, RUNTIME,FILESYSTEM, pl_id, NULL);
/*MY REPRT IS THIS PURCHASE_ORDER.REP OBVIUOSLY*/
clear_form;
go_item('PURCH_MAST.PO_NO');
end;
Previous Topic: Disply records Horizontly in Reports
Next Topic: Dot-matrix printing
Goto Forum:
  


Current Time: Sun Jan 16 21:20:34 CST 2022