Girish R Acharya
Girish R Acharya

Reputation: 140

report is working but can't able to get output of the report

i am able to call report successfull but i am not get the output of the report . reoprt must generate PDF. repport is not able to generate pdf . code is

DECLARE 
rept REPORT_OBJECT; 
v_rep VARCHAR2(100); 
rep_status varchar2(200); 
BEGIN 

rept := find_report_object('EMP.RDF'); 

SET_REPORT_OBJECT_PROPERTY(rept ,REPORT_SERVER , 'repsrv'); 
SET_REPORT_OBJECT_PROPERTY(rept,REPORT_DESTYPE,CACHE); 
SET_REPORT_OBJECT_PROPERTY(rept,REPORT_DESFORMAT,' HTML');


v_rep := RUN_REPORT_OBJECT(rept); 
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 
message('REPORT WAS CORRECTLY RUN'); 
ELSE 
message('REPORT FAILED WITH STATUS: '||rep_status); 
END IF;  
END;

plss help me

Upvotes: 0

Views: 2869

Answers (2)

GriffeyDog
GriffeyDog

Reputation: 8386

You will want to use web.show_document to get the output of the report. For example:

web.show_document('/reports/rwservlet/getjobid' || substr(v_rep,length('repsrv')+2) || '?server=' || 'repsrv','_blank');

Or, use the builtin copy_report_object_output() to copy the output to a file:

copy_report_object_output(v_rep, 'c:\myreport.pdf');

Also, if you want PDF output you need to change your DESFORMAT parameter to:

SET_REPORT_OBJECT_PROPERTY(rept,REPORT_DESFORMAT,'PDF'); 

Upvotes: 1

psaraj12
psaraj12

Reputation: 5072

Two things you need to look

1)the find_report_object should have the report name you created in form builder

2)you need to use

SET_REPORT_OBJECT_PROPERTY(rept, REPORT_FILENAME, 'C:\EMP.RDF');

where C:\EMP.RDF is the path in which the report should be generated

For complete example to do this and test please have a look at the below link

https://forums.oracle.com/forums/thread.jspa?threadID=2238519

Upvotes: 1

Related Questions