call report from oracle
Posted by MuhammadFaisal May 10, 2019
Just create a program unit in your form , just copy paste this code.
PROCEDURE run_report_object_proc (
report_id report_object,
report_server_name VARCHAR2,
report_format VARCHAR2,
report_file_name VARCHAR2,
report_otherparam VARCHAR2,
reports_servlet VARCHAR2)
IS
report_message VARCHAR2 (1000) := '';
rep_status VARCHAR2 (1000) := '';
vjob_id VARCHAR2 (4000) := '';
BEGIN
SET_REPORT_OBJECT_PROPERTY (report_id, report_comm_mode, synchronous);
SET_REPORT_OBJECT_PROPERTY (report_id, report_filename, report_file_name);
SET_REPORT_OBJECT_PROPERTY (report_id, report_server, report_server_name);
SET_REPORT_OBJECT_PROPERTY (report_id, report_destype, CACHE);
SET_REPORT_OBJECT_PROPERTY (report_id, report_desformat, report_format);
SET_REPORT_OBJECT_PROPERTY (report_id, report_other, 'paramform=no '||report_otherparam);
report_message := RUN_REPORT_OBJECT (report_id);
rep_status := REPORT_OBJECT_STATUS (report_message);
IF rep_status = 'FINISHED' THEN
vjob_id := SUBSTR (report_message, LENGTH (report_server_name)+2, LENGTH(report_message));
web.show_document (reports_servlet||'/getjobid'||vjob_id||'?server='||report_server_name, '_blank');
ELSE
message ('Report failed with error message '||rep_status);
END IF;
END;
And create a object in form
Named ‘report’
After this write this code on button where you have to call report
:global.reportserver:='rep_appsrv1_FRHome1'; /* your report server name */
declare
report_id report_object := find_report_object('report');
v_report_other varchar2(4000);
reports_servlet VARCHAR2(1000) := '/reports/rwservlet';
begin
v_report_other := 'p_deptno='||:control.deptno; /* ur parameters * /
run_report_object_proc(report_id, :global.reportserver, 'pdf', 'urreport.rdf', v_report_other,reports_servlet);
end;
No comments:
Post a Comment