run_report_object with parameter form [message #435051] |
Mon, 14 December 2009 00:46 |
rkgoyal98
Messages: 39 Registered: October 2009
|
Member |
|
|
Hello,
I have written code for calling reports from the form when parameter is specified. It opens report parameter form when no parameter is supplied on the form.
DECLARE
L_PATH VARCHAR2(100);
PL_ID PARAMLIST;
PL_NAME VARCHAR2(10) := 'JUST8';
L_REPNAME VARCHAR2(30);
VC_REPORTOBJ VARCHAR2(100);
V_REPORT_ID REPORT_OBJECT;
VC_REPORTSERVER VARCHAR2(100);
VC_RUNFORMAT VARCHAR2(100);
VC_DESNAME VARCHAR2(100);
STR_REPORT_JOBID VARCHAR2(100);
STRSERVER VARCHAR2(100);
HIDDEN_ACTION VARCHAR2(2000):='';
BEGIN
L_REPNAME:=:PARAMETER.REPNME;
SELECT REPORTPATH, APPSERVER,REP_SERVER_NAME INTO L_PATH,STRSERVER, VC_REPORTSERVER FROM PRMAUSER;
PL_ID := GET_PARAMETER_LIST(PL_NAME);
IF ID_NULL(PL_ID) = FALSE THEN
DESTROY_PARAMETER_LIST(PL_ID);
PL_ID := CREATE_PARAMETER_LIST(PL_NAME);
IF ID_NULL(PL_ID) THEN
MESSAGE('ERROR CREATING PARAMETER LIST '||PL_NAME);
RAISE FORM_TRIGGER_FAILURE;
END IF;
ELSE
PL_ID := CREATE_PARAMETER_LIST(PL_NAME);
END IF;
ADD_PARAMETER(PL_ID, 'MODE', TEXT_PARAMETER, 'BITMAP');
ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'CACHE');
ADD_PARAMETER(PL_ID, 'DESFORMAT', TEXT_PARAMETER, 'PDF');
ADD_PARAMETER(PL_ID, 'PARAMFORM', TEXT_PARAMETER, 'NO');
ADD_PARAMETER(PL_ID, 'P_GROUPUNIT', TEXT_PARAMETER, :P_GROUPUNIT);
VC_REPORTOBJ:=L_PATH||L_REPNAME;
V_REPORT_ID:= FIND_REPORT_OBJECT('REPORT18');
SET_REPORT_OBJECT_PROPERTY(V_REPORT_ID, REPORT_FILENAME, VC_REPORTOBJ);
SET_REPORT_OBJECT_PROPERTY(V_REPORT_ID,REPORT_EXECUTION_MODE,BATCH);
SET_REPORT_OBJECT_PROPERTY(V_REPORT_ID,REPORT_COMM_MODE,ASYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(V_REPORT_ID,REPORT_SERVER,VC_REPORTSERVER);
IF :P_GROUPUNIT IS NULL THEN
SET_REPORT_OBJECT_PROPERTY(V_REPORT_ID,REPORT_OTHER ,'PARAMFORM=YES');
HIDDEN_ACTION := (HIDDEN_ACTION || '&REPORT='||GET_REPORT_OBJECT_PROPERTY(V_REPORT_ID,REPORT_FILENAME));
HIDDEN_ACTION := HIDDEN_ACTION||'&DESTYPE=CACHE';
HIDDEN_ACTION := HIDDEN_ACTION||'&DESFORMAT=PDF';
HIDDEN_ACTION := HIDDEN_ACTION ||'&MODE=BITMAP&USERID='||GET_APPLICATION_PROPERTY(USERNAME)
||'/'||GET_APPLICATION_PROPERTY(PASSWORD)
||'@'||GET_APPLICATION_PROPERTY(CONNECT_STRING);
HIDDEN_ACTION := 'HTTP://'||STRSERVER||'/reports/rwservlet/'
||'?_HIDDEN_SERVER='||VC_REPORTSERVER||(HIDDEN_ACTION);
SET_REPORT_OBJECT_PROPERTY(V_REPORT_ID,REPORT_OTHER,'PFACTION='||HIDDEN_ACTION||' PARAMFORM=YES');
END IF;
:GLOBAL.VC_REPORT_JOB_ID:=RUN_REPORT_OBJECT(V_REPORT_ID,PL_ID);
:GLOBAL.VC_REP_STATUS :=REPORT_OBJECT_STATUS(:GLOBAL.VC_REPORT_JOB_ID);
WHILE :GLOBAL.VC_REP_STATUS IN ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
:GLOBAL.VC_REP_STATUS :=REPORT_OBJECT_STATUS(:GLOBAL.VC_REPORT_JOB_ID);
END LOOP;
IF :GLOBAL.VC_REP_STATUS='FINISHED' THEN
MESSAGE(:GLOBAL.VC_REP_STATUS);
STR_REPORT_JOBID:=(SUBSTR(:GLOBAL.VC_REPORT_JOB_ID,
LENGTH(VC_REPORTSERVER)+2,LENGTH(:GLOBAL.VC_REPORT_JOB_ID)));
WEB.SHOW_DOCUMENT ('HTTP://'||STRSERVER||'/reports/rwservlet/getjobid'
||STR_REPORT_JOBID||'?server='||VC_REPORTSERVER);
ELSE
MESSAGE ('REPORT FAILED WITH ERROR MESSAGE '||:GLOBAL.VC_REP_STATUS);
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
END; [EDITED by DJM: cut overly long lines]
[Updated on: Thu, 18 March 2010 01:19] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: run_report_object with parameter form [message #438912 is a reply to message #435051] |
Wed, 13 January 2010 00:34 |
tamzidulamin
Messages: 132 Registered: October 2009 Location: Dhaka
|
Senior Member |
|
|
Hello Dear,
First configure rep server & report key by the following way:
rep_server must install & start
01. rwserver -install server = rep_server
Rep_key is must be defined in the following location
'\\DevSuiteHome\report\conf\cgicmd.dat' as
02. Rep_key:rep_server userid=test/test@database[/email][/email] %*
PROCEDURE run_report(p_rpt_name varchar2,
p_dest varchar2 default 'C'
)
IS
v_url varchar2(2000);
v_cur_form_name varchar2(100);
v_length number;
vPath_Sep char(1);
v_rpt_name_with_path varchar2(500);
v_rpt_format varchar2(50):='pdf'; -- Example: pdf,html,xml etc.
v_rpt_key varchar2(50):='Rep_key';
v_para_form varchar2(3) :='NO'; -- YES/NO
v_dest varchar2(20);
v_rpt_builder varchar2(200);
v_rpt_server varchar2(50);
BEGIN
--------Report_Path -------------
v_cur_form_name:=get_application_property(current_form);
if get_application_property(operating_system) in ('MSWINDOWS', 'MSWINDOWS32', 'WIN32COMMON') then
vPath_Sep := '\';
else
vPath_Sep := '/';
end if;
v_length:=instr(v_cur_form_name,vPath_Sep,-1);
--Getting Current Report Name With Path.
v_rpt_name_with_path:=substr(v_cur_form_name,1,v_length)||'Reports'||vPath_Sep||p_rpt_name;
------Report Destination-----
v_dest:=upper(p_dest);
if v_dest ='C' then
v_dest:='cache';
elsif v_dest='P' then
v_dest:='printer';
elsif v_dest='M' then
v_dest:='mail';
elsif v_dest='F' then
v_dest:='file';
end if;
-------Start Call Report----------
v_url:= '/reports/rwservlet?'||v_rpt_key
||'&desformat=' ||v_rpt_format
||'&destype=' ||v_dest
||'¶mform=' ||v_para_Form
||'&report=' ||v_rpt_name_with_path;
web.show_document(v_url, '_blank');
--------End Call Report---------
exception
when others then null;
end;
Now run the above procedure form Developer10g Form.
Regards
Tamzidul Amin [EDITED by DJM: remove long blank line]
[Updated on: Thu, 18 March 2010 01:22] by Moderator Report message to a moderator
|
|
|
Re: run_report_object with parameter form [message #441237 is a reply to message #435051] |
Fri, 29 January 2010 11:25 |
rkgoyal98
Messages: 39 Registered: October 2009
|
Member |
|
|
Hello,
I tried to work ot the method given by you, however there am not able to set rep_key in cgicmd.dat file. I am enclosing my file here kindly tell me what mistake i am making.
Another aspect about your code is that if we have reports in character mode originally then there is error REP-1920
REP-1920: Character mode runtime incompatible with DESFORMAT of PDF, HTML, HTMLCSS, SPREADSHEET or RTF.
This can be solved by adding &mode=bitmap in the v_url
v_url:= '/reports/rwservlet?'||v_rpt_key
||'&mode=bitmap'
||'&desformat=' ||v_rpt_format
||'&destype=' ||v_dest
||'¶mform=' ||v_para_Form
||'&report=' ||v_rpt_name_with_path;
And my next Question is about hidding a part of Report_Path, I mean if we can hide the part in the rep_key itself
i.e.
rep_key: userid=abc/[email]abc@abc report=d:\abc\reports\
can ther be 2 diffrent keys in the cgicmd file
rep_key1: userid=abc/abc@abc report=d:\abc\reports\
rep_key2: userid=xyz/xyz@xyz report=d:\xyz\reports\
with this reportname can be added under v_url
v_url:= '/reports/rwservlet?'||v_rpt_key
||v_rpt_name
||'&mode=bitmap'
||'&desformat=' ||v_rpt_format
||'&destype=' ||v_dest
||'¶mform=' ||v_para_Form;
Regards
-
Attachment: cgicmd.dat
(Size: 4.39KB, Downloaded 2626 times)
[Updated on: Fri, 29 January 2010 11:38] Report message to a moderator
|
|
|
|
|
|
|
Re: run_report_object with parameter form [message #672167 is a reply to message #450394] |
Thu, 04 October 2018 23:51 |
|
HasnainAli
Messages: 6 Registered: September 2018
|
Junior Member |
|
|
Good Morning Every One.
I am new in Oracle 10g form and report.
I create a Report.It call from Oracle Form on button press trigger by using WEB.SHow_doc() function it Working fine and my report is called.
But when i Create desktop shortcut to run my application from desktop then application form runs but report is not runs.
I make package of my application using (ThinForm - For Oracle extension in google chrom and ThinApplet JAR.EXE to create the desktop icon to run my application from desktop).
Please tell me why my report is not call from package that i created ?
thanks in advanced
|
|
|