This content has been marked as final. Show 2 replies
I am working on Oracle APEX 4.1 to send the report as an attachment through mail I am unable to get the document while calling the APEX_UTIL.get_print_document. I have created a report query and report template (rtf template) so as to send the report as an email attachment. The report works fine individually upon clicking of button so there is no issue in BI publisher configuration. I am sure there is something very trivial which I am missing out here. Any help will be appreciated.
l_document := APEX_UTIL.GET_PRINT_DOCUMENT
p_print_server => 'f?p=&APP_ID.:0:&SESSION.:PRINT_REPORT=Sample_Report'
IF l_document is null
dbms_output.put_line( ' no report returned');
l_error_msg:='<html> <body> <h1 > Apologies the report was not returned from the apex , as there is some printing issues </h1> </body> </html> ';
IF l_error_msg IS NULL THEN
l_id := APEX_MAIL.SEND(
p_to => 'email@example.com',
p_from => 'firstname.lastname@example.org',
p_subj => 'APEX_MAIL with attachment',
p_body => 'Please review the attachment.',
p_body_html => '<b>Please</b> review the attachment' || l_error_msg);
IF l_document is not null then
p_mail_id => l_id,
p_attachment => l_document,
p_filename => 'Sample_Report.pdf',
p_mime_type => 'application/pdf');
Here the output says no report returned.
Thanks & Regards