8
votes

I've got an interactive report in Apex with some columns. The user has the option to download the report as CSV file with the standard functionality.

Is there a way to hide a column in the export but display it on the screen.

(Background: one column is a custom link that should not be exported into the CSV)

Thank you ! Paul

2

2 Answers

13
votes

You can hide it by putting a condition on the column of type PL/SQL Expression and using the following as the expression:

NVL(:REQUEST,'EMPTY') NOT IN('CSV','XLS','PDF','XML','RTF','HTMLD')

That will check the APEX bind variable "REQUEST", and if it is CSV, XLS, PDF, XML, RTF or HTML then the column will not be shown!

More info
To stop a column from showing up for an email, you can use the following:

NVL(wwv_flow.g_widget_action, 'EMPTY') != 'SEND_EMAIL'
2
votes

This one did not work for me:

NVL(:REQUEST,'EMPTY') NOT IN('CSV','XLS','PDF','XML','RTF','HTMLD')

So another workaround could be the following:

instr(nvl(:REQUEST,'~'),'XLS') = 0 and instr(nvl(:REQUEST,'~'),'PDF') = 0 and instr(nvl(:REQUEST,'~'),'HTMLD') = 0

Same logic applies for csv, rtf, etc.