How to run a report from Forms 9i

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;
acotunoaeiAsked:
Who is Participating?
 
Helena MarkováConnect With a Mentor programmer-analystCommented:
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
 
sujit_kumarCommented:
See this document. It's very useful for what you are trying.
http://www.oracle.com/technology/products/forms/pdf/277282.pdf
0
 
acotunoaeiAuthor Commented:
Sorry for the delay.

The solution works.

Thanks a lot.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.