Hi,
I have a Comments column in couple of reports, when clicked "Show All Comments" for that row, under that column, modal dialog opens and it just lists the comments as text/html. I need the option to download existing comment(s) for particular row to CSV.
Later on I'll need to have comment, date, commented by, downloaded, but for a start, I'm just trying to download visible comment text only.
Tried this:
declare
l_html clob;
begin
-- Set the MIME type
owa_util.mime_header( 'application/octet', FALSE );
-- Set the name of the file
htp.p('Content-Disposition: attachment; filename="comments.csv"');
-- Close the HTTP Header
owa_util.http_header_close;
l_html := xxext_ap_inv_apex_wrp.func_show_gen_comments(
p_table_name => :P12_TABLE_NAME,
p_primary_key_id => :P12_INVOICE_ID,
p_comment_type => 'COMMENT'
);
-- Print out a portion of a row,
-- separated by commas and ended by a CR
htp.prn(l_html || chr(13));
-- Send an error code so that the
-- rest of the HTML does not render
htmldb_application.g_unrecoverable_error := true;
end;
xxext_ap_inv_apex_wrp.func_show_gen_comments procedure gets the comments basically.
This code is from https://spendolini.blogspot.hr/2006/04/custom-export-to-csv.html
But the download doesn't happen. What else should I do in APEX 5.0.1 to pull down this data in CSV format?
Thanks