Apex - Interactive Report - Hide Column in CSV Download?
Asked Answered
C

4

8

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

Credulity answered 14/3, 2012 at 11:2 Comment(0)
N
13

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'
Narra answered 20/3, 2012 at 20:12 Comment(1)
As of 19.2, these request values are appearing as IR[R47011529768140720]_HTMLD, IR[R47011529768140720]_CSV - so perhaps these should now be LIKE statements?Britishism
V
4

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.

Vaniavanilla answered 5/12, 2017 at 11:4 Comment(0)
S
0

The most upvoted answer didn't work for me.

The workaround from @George worked for me as well:

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

I applied this at an Interactive Report column (APEX 21.2)

Strasser answered 20/9, 2022 at 13:38 Comment(0)
F
0

Create 2 columns.

For the column with URL the Server-side plsql expression should read:

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

For the column WITHOUT the URL the Server-side plsql expression should read:

not(instr(nvl(:REQUEST,'~'),'XLS') = 0 and instr(nvl(:REQUEST,'~'),'CSV') = 0 
and
instr(nvl(:REQUEST,'~'),'HTML') = 0 and instr(nvl(:REQUEST,'~'),'PDF') = 0)
Folks answered 13/3 at 23:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.