Home » Developer & Programmer » Forms » calling reports9i from forms9i
calling reports9i from forms9i [message #140270] |
Mon, 03 October 2005 05:51 |
supriya_546
Messages: 56 Registered: October 2005 Location: hyderabad
|
Member |
|
|
Hi,
I am calling report9i from forms9i.
i am getting following error
invalid report id
when i call a report from form in when button pressed trigger.
and also giving the following error
argument(1) can't be null.
v_rep varchar2(100);
v_rep := run_report_object('report5',pl_id);
or
rep_object report_object;
v_rep varchar2(100);
rep_object := find_report('report5');
v_rep := run_report_object(rep_object,pl_id);
where pl_id is the parameter list
thanks in advance
supriya
|
|
|
Re: calling reports9i from forms9i [message #140272 is a reply to message #140270] |
Mon, 03 October 2005 06:01 |
sanka_yanka
Messages: 184 Registered: October 2005 Location: Kolkata
|
Senior Member |
|
|
U can Try to use this code
PROCEDURE CALL_REPORT(REP_NAME IN VARCHAR2,para_list in varchar2) IS
Report_Id report_object;
hTimer timer;
vcFile varchar2(255);
vcResult varchar2(30);
pl_id ParamList;
GEN_NUMBER NUMBER(2);
rootDir Varchar2(255);
ServerName Varchar2(255);
repServerName Varchar2(255);
begin
/* Feteches the values of rootdir,servername from a table */
Select rootDir
into rootDir
from tblConnectingString;
Select ServerName
into ServerName
from tblConnectingString;
select Report_Server
into repServerName
from tblConnectingString;
pl_id := get_parameter_list('pres1');
SELECT PRESGEN.NEXTVAL INTO GEN_NUMBER FROM DUAL;
vcFile := REP_NAME||GEN_NUMBER||'.pdf';
:GLOBAL.FILE_NAME := vcFile;
report_id:= FIND_REPORT_OBJECT(REP_NAME);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_EXECUTION_MODE,BATCH);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,FILE);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,'pdf');
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESNAME,rootDir||vcFile);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER,repServerName);
--Reports_Server_TNS
:GLOBAL.ReportHandle := RUN_REPORT_OBJECT(report_id,'pres1');
:GLOBAL.PrintOutPut := vcFile;
hTimer := CREATE_TIMER(:GLOBAL.FILE_NAME||'PRINTER_QUEUE','75000',REPEAT);
web.show_document('http://'||ServerName||'/'||:GLOBAL.FILE_NAME,'_blank');
END;
Best Wishes,
Bye Sanka
Upd-Mod: Added 'code' start and stop tags.
[Updated on: Mon, 03 October 2005 20:07] by Moderator Report message to a moderator
|
|
|
Re: calling reports9i from forms9i [message #140295 is a reply to message #140272] |
Mon, 03 October 2005 09:07 |
supriya_546
Messages: 56 Registered: October 2005 Location: hyderabad
|
Member |
|
|
Hi,
Thanks for immediate reply.
when i select data from tblConnectingString,
it's giving "table or view doesn't exists error" .
I checked this table in SYS user also. can u pls help me where this table(view) is actually stored & how to access it.
i tried with
SET_REPORT_OBJECT_PROPERTY also.but my problm is not solved.
thanks
supriya
|
|
|
|
Re: calling reports9i from forms9i [message #140389 is a reply to message #140362] |
Tue, 04 October 2005 00:04 |
supriya_546
Messages: 56 Registered: October 2005 Location: hyderabad
|
Member |
|
|
Hi David,
I am using forms9i & reports 9i on windows2000 platform.
I checked for this table (tblConnectingString) in sys user
by connecting as a sysdba.still it's giving same error.
thanks
supriya
|
|
|
|
|
Re: calling reports9i from forms9i [message #140483 is a reply to message #140391] |
Tue, 04 October 2005 08:17 |
supriya_546
Messages: 56 Registered: October 2005 Location: hyderabad
|
Member |
|
|
Hi david & sanka/yanka,
thanks for immediate replies.
i am writing here just what i tried till now.i think this info is enough.
following code i have written in when button pressed trigger
declare
report_id REPORT_OBJECT;
V_REP VARCHAR2(100);
pl_id ParamList;
begin
pl_id := Create_Parameter_List('tmpdata');
Add_Parameter(pl_id, 'CSS', TEXT_PARAMETER, :Q_CUSTOMER_ID);
Add_Parameter(pl_id, 'SITEID', TEXT_PARAMETER, :Q_SITE_ID);
Add_Parameter(pl_id, 'MAXIMIZE', TEXT_PARAMETER, 'YES');
report_id := FIND_REPORT_OBJECT('TASKS_NOTINVOICED_RATE');
-- here TASKS_NOTINVOICED_RATE is the report object defined in
-- report node of object navigator.
-- in report object i tried both RDF & REP. which one is correct?
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_EXECUTION_MODE,RUNTIME);
-- here i tried both batch & runtime
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,SCREEN);
-- here i tried both screen & file
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_OTHER,'paramform=NO');
v_rep := run_report_object(report_id,pl_id);
end;
same parameters i defined in the report object also.
without parameters also i tried by setting initial values in report.
individual report is running fine.
oc4j is running on my system.
i am using forms9i,reports9i on windows2000.
forms_path & reports path is fine in registry.
i kept my RDF & REP in forms path.
forms90_path : here i mentioned both forms path & reports path.
error : ****************************
now i am getting the error as
rep-0503 : u did not specify the name of a report.
some times its giving unable to run the report,
if i change any of above parameters.
i didn't give any report server name in report object.
is it necessary to give this one?????????? or registry path is enough for this????? remember individual report is running on my system.
any other things i need to set for this.
sanka can u pls tell me what is the use of "tblconnectingstring" table in this.
thanks in advance
supriya
Upd-mod: Added start and end code tags.
[Updated on: Tue, 04 October 2005 20:13] by Moderator Report message to a moderator
|
|
|
|
Re: calling reports9i from forms9i [message #140664 is a reply to message #140601] |
Wed, 05 October 2005 02:38 |
supriya_546
Messages: 56 Registered: October 2005 Location: hyderabad
|
Member |
|
|
Hi David,
i added those 2 statements.now it's not showing any errors
& also the report o/p.
simply its executing that part of code & not showing the report output.
repserver90 is running on my system.
is anything need to be add.
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,'html');
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER,'repserver90');
desformat i am using html. any other syntax i need to change,
bec.. i am using html format.
and i need syntax for non html reports also..
can u pls help in this...........
thanks
supriya
|
|
|
|
|
Re: calling reports9i from forms9i [message #140688 is a reply to message #140684] |
Wed, 05 October 2005 04:15 |
supriya_546
Messages: 56 Registered: October 2005 Location: hyderabad
|
Member |
|
|
Hi david,
Select connString
into connString
from tblConnectingString;
tblConnectingString : is this oracle table or user defined table?
if it is user defined table how to get the server name ?
is it db server name?
WEB.SHOW_DOCUMENT('http://'||ServerName||':8888/reports/rwservlet?destype=CACHE&desformat=PDF&report=PRESCRIPTION_PI_LP.rdf&a mp;userid='||connString||'&P_REGNNO='||:MAST.REGNNO||'&P_PID='||:MAST.PATIENTID||'&P_PRESNO='||:MAST.PRESNO);
thanks
supriya
in this PDF is generating after the report is opened in the html or directly PDF is generated?
|
|
|
|
Re: calling reports9i from forms9i [message #141496 is a reply to message #140846] |
Mon, 10 October 2005 09:27 |
supriya_546
Messages: 56 Registered: October 2005 Location: hyderabad
|
Member |
|
|
Hi David,
sorry o/p means output.from next time onwards i don't use abbreviations.
pls can u elaborate ur explanation.
i got report output in PDF format.
i am trying it in HTML format but,not getting report in HTML format.
i am using forms9i & reports9i.
my reports are stored in forms path only.
i am using repserver90 as report server.
so,while calling the report by using web.show_document
which path, i have to use. (i stored my report in foms path)
pls tell me the syntax if the report is stored in reports path
also.both i am testing.
can u pls explain elaborately what u have mentioned above.
at present report server is running only on my pc.
and sorry remaining part i didn't understand.(what u have given in ur reply)
if possible please give me immediate reply.
thank u very much
supriya
|
|
|
|
Re: calling reports9i from forms9i [message #141568 is a reply to message #141562] |
Tue, 11 October 2005 00:33 |
supriya_546
Messages: 56 Registered: October 2005 Location: hyderabad
|
Member |
|
|
Hi David,
2) Do you have 'REPORTS_PATH' defined in your register?
-- yes its defined.
(3) Do you have the directory containing 'report5' at the 'beginning' of that register string?
-- no, can u pls tell me how to define it.is it necessary to define it to run the reports.only reports_path is not enough?
(4) oc4j is running on my pc
Are there any other machines in your installation running 'repserver90' as their server name?
-- no, this serevr is running only on my pc.
can u tell me which type of problem we get if this server is running on any other machines?
when i run "http://<machine_sid>:7778/reports/rwservlet?help"
in browser after i started oc4j, its giving page can't be displayed", i tried without help also. same answer.
thank u
supriya
|
|
|
|
|
Re: calling reports9i from forms9i [message #141654 is a reply to message #141598] |
Tue, 11 October 2005 08:07 |
supriya_546
Messages: 56 Registered: October 2005 Location: hyderabad
|
Member |
|
|
Hi David ,
thanks i got report in html format.
BUT ONE SMALL PROBLEM
when i attach RDF fomat to form report output is comming.
when i attach REP format its giving error
FRM-41214 : UNABLE TO RUN THE REPORT &
FRM-41217 : UNABLE TO GET REPORT JOB STATUS
THANK U
SUPRIYA
|
|
|
Re: calling reports9i from forms9i [message #141735 is a reply to message #141598] |
Tue, 11 October 2005 20:06 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Quote: | my forms90_path & reports_path is the same, i have taken care proper report path in reports_path.
| They should NOT be the same. They were different when Forms and Reports were installed, all you need do it UPDATE them by adding your directory to the BEGINNING of the path list. Tehre are specific reports and forms bits and pieces that live in DIFFERENT directories and they need to be in the paths. Be careful, forms path can be 512 characters long, but the reports path can only be 256 characters long. Also NONE of the directories can have a 'space / blank' in their name, nor can they be empty (have no members in any of them).
You DON'T need to have a run_report_object when you use web.show_document.
I recommend that you do NOT use REP files (these are the compiled ones right - I mucked up a previous response by getting the file types around the wrong way). I had a similar problem and I don't think we ever solved it. We just deleted them all and just used the RDF file. We didn't perceive a difference in performance. But we probably didn't look too hard either.
David
[Updated on: Tue, 11 October 2005 20:06] Report message to a moderator
|
|
|
Re: calling reports9i from forms9i [message #144327 is a reply to message #140270] |
Wed, 26 October 2005 01:13 |
supriya_546
Messages: 56 Registered: October 2005 Location: hyderabad
|
Member |
|
|
Hi David,
Thanks for immediate replies.
I am calling reports from forms(please just go through the above discussion).it's working fine using "HTML" format
i am attaching " REP " to my form. its working in my system.
but its giving error in client side.
FRM-41213 : unable to connect to report server server_name
NOTE :They are able to run their own reports.
we have one table in that they insert url & report server name .
by using function i am fetching those values & placing those into web.show_document statement. here is the my code.
i can't attach RDF to form.we send only REP's to the client.
DECLARE
v_rep varchar2(100);
report_id REPORT_OBJECT;
rep_status VARCHAR2(20);
url varchar2(100);
rep_server varchar2(30);
pl_id ParamList;
begin
Pl_id := Create_Parameter_List('tmpdata');
Add_Parameter(pl_id, 'CSS', TEXT_PARAMETER, :Q_CUSTOMER_ID);
Add_Parameter(pl_id, 'SITE', TEXT_PARAMETER, :Q_SITE_ID);
Add_Parameter(pl_id, 'TT', TEXT_PARAMETER, :Q_TASK_TYPE);
Add_Parameter(pl_id, 'FD', TEXT_PARAMETER, :Q_FROM_DATE);
Add_Parameter(pl_id, 'TD', TEXT_PARAMETER, :Q_TO_DATE);
Add_Parameter(pl_id, 'FLG', TEXT_PARAMETER, FLAG);
Add_Parameter(pl_id, 'MAXIMIZE', TEXT_PARAMETER, 'NO');
url := fetch_url(rep_server); /* calling function to fetch url
& repserver name */
report_id := FIND_REPORT_OBJECT('TASKS_UNRATED');
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_EXECUTION_MODE,BATCH);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,CACHE);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,'HTML');
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER,rep_server);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_OTHER,'paramform=NO');
v_rep := run_report_object(report_id,pl_id);
rep_status := REPORT_OBJECT_STATUS(v_rep);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(v_rep);
END LOOP;
--****************
IF rep_status = 'FINISHED' THEN
WEB.SHOW_DOCUMENT(url||'/getjobid'||
substr(v_rep,instr(v_rep,'_',-1)+1)
||'?'||'server='||rep_server,'_blank');
ELSE
message('Error when running report');
END IF;
end;
values :
url : http://172.12.12.5/reports/rwservlet
server : servername
i am extracting only one part of link & appending remaining part in web.show_document.
can u please help in this.
thanks
supriya
|
|
|
|
Re: calling reports9i from forms9i [message #144538 is a reply to message #140270] |
Wed, 26 October 2005 23:54 |
supriya_546
Messages: 56 Registered: October 2005 Location: hyderabad
|
Member |
|
|
u mean to say put like this
Pl_id := Create_Parameter_List('tmpdata');
-- adding parameters
report_id := FIND_REPORT_OBJECT('TASKS_UNRATED');
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_EXECUTION_MODE,BATCH);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,CACHE);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,'HTML');
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER,rep_server);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_OTHER,'paramform=NO');
v_rep := run_report_object(report_id,pl_id);
---- I think the above statement is must.
WEB.SHOW_DOCUMENT(url||'/getjobid'||
substr(v_rep,instr(v_rep,'_',-1)+1)
||'?'||'server='||rep_server,'_blank');
but when i am getting report output in my system why its giving problem in client system.is there any other reasons for this.
so,that i can clarify with client.
and please remember i am attaching .rep to form not rdf.
i am not using any connection string in this statement.
can u send me where i have to add this in web.show_document statement.
what type of problems i get if i attach rep.
waiting for ur immediate reply
thanks
supriya
|
|
|
Re: calling reports9i from forms9i [message #144539 is a reply to message #144538] |
Thu, 27 October 2005 00:01 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Try using the 'web' half of this code.DECLARE
vrepid report_object;
vrep VARCHAR2 (100);
-- 09/08/2004 DJMartin Add WEB style report.
v_show_document VARCHAR2 (2000) := '/reports/rwservlet?';
v_connect VARCHAR2 (30) := 'connectionName';
-- v_report_server VARCHAR2 (30) := reportsenv_pkg.f_report_server;
v_report_server VARCHAR2 (30) := 'repserver90';
BEGIN
IF GET_APPLICATION_PROPERTY (user_interface) = 'WEB'
THEN
v_show_document := v_show_document
|| v_connect
-- Report server
|| '&server='
|| v_report_server
-- Report name
|| '&report=gnrAgenda'
-- Reports parameters
|| '&destype=CACHE'
|| '&desformat=PDF';
web.show_document (v_show_document);
ELSE
vrepid := FIND_REPORT_OBJECT ('REPORT1');
vrep := RUN_REPORT_OBJECT (vrepid);
web.show_document
( 'http://address:port/reports/rwservlet/getjobid'
|| SUBSTR (vrep, INSTR (vrep, '_', -1) + 1)
|| '?'
|| 'server=repserver90',
'_blank'
);
END IF;
END;
David
Upd: Changed 'v_report_server' line.
[Updated on: Mon, 20 February 2006 00:20] Report message to a moderator
|
|
|
Re: calling reports9i from forms9i [message #146550 is a reply to message #144331] |
Fri, 11 November 2005 00:08 |
pankaj555398
Messages: 1 Registered: November 2005
|
Junior Member |
|
|
can u tell me what to include in reports_path in windows registry. i am using forms & reports 10g.
pankaj
djmartin wrote on Wed, 26 October 2005 01:27 | I suggest that you 'lose' the 'run_report_object' and the "WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')" loop. Just use the web.show_document without the loop.
Please put a message/pause pair before your 'web' statement and display the url that you are passing to your report server.
Please post it in your reply.
David
|
|
|
|
|
|
|
|
|
Re: calling reports9i from forms9i [message #341668 is a reply to message #341664] |
Tue, 19 August 2008 21:31 |
fcazor
Messages: 3 Registered: June 2007
|
Junior Member |
|
|
i think is a good idea migrate to web.show_doc because have a lot of problems with rp2rro.
The only problem is, i don't have a generic forms module which run like parameter form.
If possible call generic html page passing parameters from forms? as you can pass parameters, by post or by get?
|
|
|
|
|
|
Goto Forum:
Current Time: Mon Feb 03 04:46:33 CST 2025
|