Home » Developer & Programmer » Forms » Call several reports from a button-pressed form
Call several reports from a button-pressed form [message #256134] |
Fri, 03 August 2007 02:06 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
scosco
Messages: 12 Registered: July 2007 Location: Port louis
|
Junior Member |
|
|
hi..i want to call several reports from a button pressed form...plz help...i work on oracle 10g server sun6,Actually the code which i use for 1 report is as follows:Plzz helep
DECLARE
v_report_id Report_Object;
vc_ReportServerJob VARCHAR2(100);
vc_rep_status VARCHAR2(100);
vjob_id VARCHAR2(100);
varstcashid varchar(35);
varstsite varchar(5);
BEGIN
v_report_id := FIND_REPORT_OBJECT('REP_PAYR006');
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESTYPE,cache);
SET_REPORT_OBJECT_PROPERTY(v_report_id, REPORT_FILENAME, 'C:\CMSWEB\payr006.jsp');
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESFORMAT,'PDF');
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_SERVER,'rep_sarah');
varstcashid:='"'||:stcashid||'"';
varstsite:='"'||:stsite||'"';
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_OTHER,'ST_CASH_ID='||varstcashid||' ST_DATE='||:stdate||' ST_SITE='||varstsite||' paramform=no' ||' copies=2');
vc_ReportServerJob := RUN_REPORT_OBJECT(v_report_id);
vjob_id := substr(vc_ReportServerJob,length('rep_sarah')+2,length(vc_ReportServerJob));
vc_rep_status := REPORT_OBJECT_STATUS(vc_ReportServerJob);
IF vc_rep_status = 'FINISHED' THEN
WEB.SHOW_DOCUMENT ('/reports/rwservlet/getjobid'|| vjob_id||'?server=rep_sarah','_blank');
ELSE
message ('Report failed with error message '||vc_rep_status);
END IF;
END;
|
|
|
|
|
|
|
Re: Call several reports from a button-pressed form [message #256934 is a reply to message #256621] |
Tue, 07 August 2007 03:29 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
scosco
Messages: 12 Registered: July 2007 Location: Port louis
|
Junior Member |
|
|
Hi david,thx for ur advice..i have been able to run 3 reports simultenously..
The following code (ive tried to arrange it wix tags but in orafaq doesnt appear) is below. However i still have some problems
1. when I treid to get rid of the run_report_object,it doesnot work,can u help me on the code plz..
2. I wanted to use a loop to run the different reports instaed of repeating the code SET_REPORT_OBJECT_PROPERTY 3 times,is that possible?
3. I dont want to run all the reports simultenously but one by one..when one is closed another one opens on format pdf.Is that possible.
thx once more david.
DECLARE
v_report_id Report_Object;
v_report_id2 Report_Object;
v_report_id3 Report_Object;
vc_ReportServerJob VARCHAR2(100);
vc_ReportServerJob2 VARCHAR2(100);
vc_ReportServerJob3 VARCHAR2(100);
vc_rep_status VARCHAR2(100);
vc_rep_status2 VARCHAR2(100);
vc_rep_status3 VARCHAR2(100);
vjob_id VARCHAR2(100);
vjob_id2 VARCHAR2(100);
vjob_id3 VARCHAR2(100);
varstcashid varchar(35);
varstsite varchar(5);
BEGIN
v_report_id := FIND_REPORT_OBJECT('REP_PAYR006');
v_report_id2 := FIND_REPORT_OBJECT('REP_PAYR007');
v_report_id3 := FIND_REPORT_OBJECT('REP_PAYR008');
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(v_report_id2,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(v_report_id3,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESTYPE,cache);
SET_REPORT_OBJECT_PROPERTY(v_report_id2,REPORT_DESTYPE,cache);
SET_REPORT_OBJECT_PROPERTY(v_report_id3,REPORT_DESTYPE, cache);
(v_report_id3,REPORT_DESTYPE,cache);
SET_REPORT_OBJECT_PROPERTY(v_report_id3,REPORT_DESTYPE, cache);
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESFORMAT,'PDF');
SET_REPORT_OBJECT_PROPERTY(v_report_id2,REPORT_DESFORMAT,'PDF');
-- SET_REPORT_OBJECT_PROPERTY(v_report_id3,REPORT_DESFORMAT,'PDF');
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_SERVER,'rep_sarah');
SET_REPORT_OBJECT_PROPERTY(v_report_id2,REPORT_SERVER,'rep_sarah');
-- SET_REPORT_OBJECT_PROPERTY(v_report_id3,REPORT_SERVER,'rep_sarah');
varstcashid:='"'||:stcashid||'"';
varstsite:='"'||:stsite||'"';
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_OTHER,'ST_CASH_ID='||varstcashid||' ST_DATE='||:stdate||' ST_SITE='||varstsite||' paramform=no' ||' copies=2');
SET_REPORT_OBJECT_PROPERTY(v_report_id2,REPORT_OTHER,'ST_CASH_ID='||varstcashid||' ST_DATE='||:stdate||' ST_SITE='||varstsite||' paramform=no' ||' copies=5');
SET_REPORT_OBJECT_PROPERTY(v_report_id3,REPORT_OTHER,'ST_CASH_ID='||varstcashid||' ST_DATE='||:stdate||' ST_SITE='||varstsite||' paramform=no' ||' copies=1');
vc_ReportServerJob := RUN_REPORT_OBJECT(v_report_id);
vc_ReportServerJob2 := RUN_REPORT_OBJECT(v_report_id2);
vc_ReportServerJob3 := RUN_REPORT_OBJECT(v_report_id3);
vjob_id := substr(vc_ReportServerJob,length('rep_sarah')+2,length(vc_ReportServerJob));
vjob_id2 := substr(vc_ReportServerJob2,length('rep_sarah')+2,length(vc_ReportServerJob2));
vjob_id3 := substr(vc_ReportServerJob3,length('rep_sarah')+2,length(vc_ReportServerJob3));
vc_rep_status := REPORT_OBJECT_STATUS(vc_ReportServerJob);
vc_rep_status2 := REPORT_OBJECT_STATUS(vc_ReportServerJob2);
vc_rep_status3 := REPORT_OBJECT_STATUS(vc_ReportServerJob2);
IF vc_rep_status = 'FINISHED' THEN
WEB.SHOW_DOCUMENT ('/reports/rwservlet/getjobid'|| vjob_id||'?server=rep_sarah','_blank');
ELSE
message ('Report failed with error message '||vc_rep_status);
END IF;
IF vc_rep_status = 'FINISHED' THEN
WEB.SHOW_DOCUMENT ('/reports/rwservlet/getjobid'|| vjob_id2||'?server=rep_sarah','_blank');
ELSE
message ('Report failed with error message '||vc_rep_status);
END IF;
IF vc_rep_status = 'FINISHED' THEN
WEB.SHOW_DOCUMENT ('/reports/rwservlet/getjobid'|| vjob_id3||'?server=rep_sarah','_blank');
ELSE
message ('Report failed with error message '||vc_rep_status);
END IF;
END;
[Updated on: Tue, 07 August 2007 03:40] Report message to a moderator
|
|
|
|
|
Re: Call several reports from a button-pressed form [message #257833 is a reply to message #257774] |
Thu, 09 August 2007 05:25 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
scosco
Messages: 12 Registered: July 2007 Location: Port louis
|
Junior Member |
|
|
ive tried to create an an array to put the following reports but it still doesnot wok.Kan anyone help me on that.
BEGIN
/*Point 2 How about using the same Report_Object and inside the loop you build the report name or use a local array for
the report names? Just put a loop around the whole body of code and execute the number of times there are
entries in the report name array.*/
FOR i IN 1..4 LOOP
Tab(1):='REP_PAYR005';
Tab(2):='REP_PAYR006';
Tab(3):='REP_PAYR007';
Tab(4):='REP_PAYR008';
v_report_id := FIND_REPORT_OBJECT('Tab(i)');
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESTYPE,cache);
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESFORMAT,'PDF');
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_SERVER,'rep_sarah');
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_OTHER,'ST_CASH_ID='||varstcashid||' ST_DATE='||:stdate||' ST_SITE='||varstsite||' paramform=no' ||' copies=1');
vc_ReportServerJob := RUN_REPORT_OBJECT(v_report_id);
vc_rep_status := REPORT_OBJECT_STATUS(vc_ReportServerJob);
vjob_id := substr(vc_ReportServerJob,length('rep_sarah')+2,length(vc_ReportServerJob));
IF vc_rep_status = 'FINISHED' THEN
WEB.SHOW_DOCUMENT ('/reports/rwservlet/getjobid'|| vjob_id||'?server=rep_sarah','_blank');
ELSE
message ('Report failed with error message '||vc_rep_status);
END IF;
END LOOP;
end;
[Updated on: Thu, 09 August 2007 05:38] Report message to a moderator
|
|
|
Re: Call several reports from a button-pressed form [message #258026 is a reply to message #257833] |
Thu, 09 August 2007 18:59 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Have a look at http://www.orafaq.com/forum/m/230700/67467/?srch=web.show_document+%27FINISHED%27#msg_230700 for how to 'loop' the 'REPORT_OBJECT_STATUS'.
But, again, I have communicated with Oracle and they will probably remove the use of 'RUN_REPORT_OBJECT' from future examples so that only the 'web.show_document' facility will be shown. I STRONGLY recommend that you ONLY use 'web.show_document' as it will AUTOMATICALLY start the report server if it is not running where 'run_report_object' DOES NOT.
Please use 'code' tags when posting code. From a coding point of view, one normally places the 'array load' BEFORE the beginning of the 'loop'.
David
PS you don't have to PM new to look at an entry in the Forms forum. I look at EVERY one ultimately, and will reply to those that I think have not been adequately answered (unless it deals with hierarchy tree about which I have no working experience).
|
|
|
Goto Forum:
Current Time: Thu Feb 13 04:56:47 CST 2025
|