oracle - Call Application Process that saves/downloads as an attachement -
i have report link (inside of classic style apex report) calls application process. set on request attribute , follows:
application_process=profile
the application process calls procedure (name of procedure "profile") inside of package. application process follows:
declare begin util_pck.profile(:id) end;
the package generates text inside of webpage. instead of generating text, upon clicking link, need prompt user download or save attachment respect mime type (which believe .pro). think i'm missing key lines of code. procedure follows:
procedure profile(profileid in number, debug in varchar2 default null) cursor svyc select p.profile_start_x, p.profile_start_y, p.surveying_org_full_name, p.survey_job_title, m.filename, m.vertical_accuracy_type, m.horizontal_datum, m.vertical_datum, m.epoch, m.projection_zone, m.units_of_measure, m.survey_job_number, m.survey_start_date survey_profiles_view p left join survey_metadata_view m on m.survey_id = p.survey_id p.survey_profile_id = profileid; svycitem svyc%rowtype; cursor proc select geom.x, geom.y, pp.* survey_profile_pts_view pp, table(sdo_util.getvertices(pp.shape)) geom survey_profile_id = profileid; pro proc%rowtype; begin open svyc; fetch svyc svycitem; owa_util.mime_header('text/plain', false); owa_util.http_header_close; htp.p('t01 file name : ' || rpad(svycitem.filename, 22) || ' order: ' || rpad(svycitem.vertical_accuracy_type, 10)|| ' horiz. datum: ' || svycitem.horizontal_datum || chr(13)); htp.p('t02 job number : ' || rpad(svycitem.survey_job_number,22)|| ' units: ' || rpad(svycitem.units_of_measure, 10) || ' vert. datum: ' || svycitem.vertical_datum || chr(13)); htp.p('t03 survey date: ' || rpad(svycitem.survey_start_date, 22) || ' zone : ' || rpad(svycitem.projection_zone, 10) || ' epoch: ' || svycitem.epoch ||chr(13)); htp.p('t04 bank ref. : channel: ' || chr(13)); htp.p('t05 contractor : ' || svycitem.surveying_org_full_name || chr(13)); htp.p('t06 levee dist.: ' || chr(13)); htp.p('t07 title : ' || svycitem.survey_job_title || chr(13)); pro in proc loop htp.p(lpad(to_char(round(pro.station, 2), '9999990.99'), 15) || lpad(to_char(round(pro.x, 2), '9999990.99'), 15) || lpad(to_char(round(pro.y, 2), '9999990.99'),15) || lpad(to_char(round(pro.elevation,2),'9990.99'),8) || ' ' || pro.point_code ); end loop; close svyc; end;
i know need line wpg_docload.download_file( );
in there i'm not sure where, or if order of code correct. on great. in advance
Comments
Post a Comment