Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

CSV Download

FlammiferMay 30 2017 — edited Jun 1 2017

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

This post has been answered by Marko Goricki on May 31 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 29 2017
Added on May 30 2017
6 comments
274 views