database - Generate & Email report from Oracle Forms 11g -
i generate report in pdf through passing of parameters oracle forms 11g. have requirement email same report automatically well. following part of forms have passed on parameters.
pl_id := create_parameter_list('tmpdata1'); add_parameter(pl_id, 'fdt', text_parameter, :a); add_parameter(pl_id, 'tdt', text_parameter, :b); add_parameter(pl_id, 'vc', text_parameter, :e); add_parameter(pl_id, 'sys_date', text_parameter, :f); add_parameter(pl_id,'destype',text_parameter,'file'); add_parameter(pl_id,'desformat',text_parameter,'pdf'); add_parameter(pl_id,'desname',text_parameter,'c:\downloads\abc.pdf'); now copy of report saved in c:\downloads folder shown in browser.
i use following procedure send current data shown in forms via emails.
create or replace procedure send4 (p_sender in varchar2, p_recipient in varchar2, p_subject in varchar2, p_message in varchar2) crlf varchar2(2) := chr(13)||chr(10); l_mailhost varchar2(255) := <ip address>; v_connection utl_smtp.connection; begin v_connection := utl_smtp.open_connection(l_mailhost, 25); utl_smtp.helo(v_connection, l_mailhost); utl_smtp.mail(v_connection, p_sender); utl_smtp.rcpt(v_connection, p_recipient); utl_smtp.data(v_connection, 'date: ' || to_char(sysdate, 'dy, dd mon yyyy hh24:mi:ss') || crlf || 'from: ' || p_sender || crlf || 'subject: '|| p_subject || crlf || 'to: ' || p_recipient || crlf || 'mime-version: 1.0'|| crlf || -- use mime mail standard 'content-type: multipart/mixed;'|| crlf || ' boundary="-----secbound"'|| crlf || crlf || '-------secbound'|| crlf || 'content-type: text/plain;'|| crlf || 'content-transfer_encoding: 7bit'|| crlf || crlf || p_message|| crlf || crlf || '-------secbound'|| crlf || 'content-type: text/plain;'|| crlf || ' name="file.txt"'|| crlf || 'content-transfer_encoding: 8bit'|| crlf || 'content-disposition: attachment;'|| crlf || ' filename="attachment.txt"'|| crlf || crlf || p_message|| crlf || -- content of attachment crlf || '-------secbound--' -- end mime mail ); utl_smtp.quit(v_connection); exception when utl_smtp.transient_error or utl_smtp.permanent_error raise_application_error(-20000, 'unable send mail', true); end; 1) can email report generated directly? tried passing parameter 'mail' , 'email address' in destype , desname guessing there settings need done?
or
2) how can use email procedure send said report attachment?
or
3) how can copy report pdf generated in user's pc specific directory @ server? because have 1 separate procedure email can mail pdfs server directly. user has windows pc while server linux.
or
4) generate report in pdf format @ server directly use procedure (#3 point) email it?
Comments
Post a Comment