?
Solved

How to run a report from Forms 9i

Posted on 2005-04-11
3
Medium Priority
?
1,521 Views
Last Modified: 2013-12-01
I want to run a report from Forms using Oracle 9i. For that i wrote the following script and created the report object named(REPORT6)

When i run the script by pressing a button , in  :agenti.nume( that is a text field in my form) is print repserver_116 (repserver is my Report Server). but , the report doesn't appear.I receive no other message.

declare
report_id Report_Object;
ReportServerJob VARCHAR2(100);
BEGIN
report_id:= find_report_object('REPORT6');
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_SERVER,'repserver');
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_FILENAME,'C:\Licenta\test.rdf');
--SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_OTHER,'p_deptno='||:agenti.id_agent||' paramform=no');
:agenti.nume:=run_report_object(report_id);
END;
0
Comment
Question by:acotunoaei
3 Comments
 
LVL 22

Accepted Solution

by:
Helena Marková earned 2000 total points
ID: 13759529
You must make some modification:

declare
 report_id Report_Object;
 ReportServerJob           VARCHAR2(100);
 rep_status                    VARCHAR2(200);
 L_REPORT_SERVER       VARCHAR2(15)    :=:agenti.nume;
 L_REPORT_SERVER_PATH  VARCHAR2(30); --  if you want to run report in a development environment e.g. 'http://yourpc:8888/reports';
 L_REPORT_DESFORMAT    VARCHAR2(15):='HTML';
 rep_status                        VARCHAR2(200);
 report_job_id                    VARCHAR2(200);
BEGIN

 report_id:= find_report_object('REPORT6');
 SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_OTHER,'p_deptno='||:agenti.id_agent||' paramform=no');

 SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_FILENAME,'C:\Licenta\test.rdf');
 SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_COMM_MODE,SYNCHRONOUS);
 SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_EXECUTION_MODE,BATCH);
 SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,CACHE);
 SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,L_REPORT_DESFORMAT);
 SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER,L_REPORT_SERVER);

    report_job_id := RUN_REPORT_OBJECT(report_id);

    rep_status:=REPORT_OBJECT_STATUS(report_job_id);

    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
       rep_status:=run_report_object(report_id);
    END LOOP;
    IF rep_status='FINISHED' THEN
-- this shows report
      WEB.SHOW_DOCUMENT(L_REPORT_SERVER_PATH||'/rwservlet/getjobid'||substr(report_job_id,instr(report_job_id,'_',-1)+1)||'?'||'server='||L_REPORT_SERVER,'_blank');    ELSE
       message('Error');
    END IF;
END;
0
 
LVL 11

Expert Comment

by:sujit_kumar
ID: 13769572
See this document. It's very useful for what you are trying.
http://www.oracle.com/technology/products/forms/pdf/277282.pdf
0
 

Author Comment

by:acotunoaei
ID: 13770947
Sorry for the delay.

The solution works.

Thanks a lot.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Integration Management Part 2
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question