declare rep_obj varchar2(10) := 'R'; rep_name varchar2(500) := :global.rpt_path ||'\'||:parameter.report_name||'.jsp'; rep_format varchar2(16) := :RG; where_cond varchar2(100) :=null; repid REPORT_OBJECT; mrep VARCHAR2(1000); mpath varchar2(2000); rep_status VARCHAR2(200); mmode varchar2(5000); mparam_list paramlist; code_list varchar2(1000) := 'report_paramlist'; cursor cur_rpt is select initcap(caption) as caption, textboxname, paraname, ordr, x, y, w, h, hint, hide from rpt_params where rpt_sl= :parameter.rptsl order by ordr; begin mparam_list := get_parameter_list(code_list); if not id_null(mparam_list) then destroy_parameter_list(mparam_list); end if; mparam_list := create_parameter_list(code_list); add_parameter(mparam_list, 'co_name', text_parameter, :global.rpt_co_name); add_parameter(mparam_list,'co_address', text_parameter, :global.rpt_co_address); add_parameter(mparam_list,'user_sl', text_parameter, :global.user_sl); for c IN cur_rpt loop if c.hide = 0 then message(':report.'||c.textboxname || ' and --> '||:report.char1); add_parameter(mparam_list, c.paraname, text_parameter, :report.char1);--':report.'||c.textboxname); end if; if c.hide=1 then if :parameter.typ is not null then add_parameter(mparam_list, c.paraname, text_parameter, :parameter.typ); end if; if :parameter.drange_sl is not null then add_parameter(mparam_list, c.paraname, text_parameter, :parameter.drange_sl); end if; end if; end loop; repid := find_report_object(rep_obj); set_Report_object_property(repid,report_filename,rep_name); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,BATCH); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,MAIL); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,rep_format); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESNAME,'abcd@gmail.com'); SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'From=xyz@xyzsystem.com ,CC=jklmn@gmail.com,Subject=My Subject') ; SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,:global.rpt_server_name); mmode := where_cond||' mode=default'; --set_report_object_property(repid,report_other,v_mode); --set_report_object_property(repid, report_other, 'paramform=no'); mrep := RUN_REPORT_OBJECT(repid,mparam_list); rep_status := REPORT_OBJECT_STATUS(mrep); while rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED') loop rep_status := report_object_status(mrep); end loop; mpath := 'http://'||:global.rpt_host_name||':'||:global.rpt_port||'/reports/rwservlet/getjobid' || substr(mrep,instr(mrep,'_',-1)+1)||'?'||'server='||:global.rpt_server_name; WEB.SHOW_DOCUMENT(mpath,'_blank'); if rep_status <> 'FINISHED' then message('Report Failure '||rep_status); end if; destroy_parameter_list(code_list); exception when others then b.err_i (get_form_property(:system.current_form,form_name) || ' in fba90001 preview button ', 'form', sqlcode || ' ' || sqlerrm ); f.dummy := f.msg(sqlcode || ' ' || sqlerrm,1,1); raise form_trigger_failure; END;