Home > ApEx > Hide/Show columns only when exporting to .CSV

Hide/Show columns only when exporting to .CSV

This is a little trick that doesn’t seem that widely known. When using the “Export to Excel” functionality in ApEx to allow the generation of a .CSV file from a report region, you may want for certain columns not to be included in the .CSV. Equally, you may want certain columns to be included in the .CSV that aren’t visible in the rendered report region itself.

This is easy to do…
For those columns that you want to appear in the report region ONLY, set their condition to type “PL/SQL Expression” and the condition itself to:

WWV_FLOW.g_excel_format = false

And for those columns that you want to appear in the .CSV ONLY, set their condition to type ‘PL/SQL Expression” and the condition itself to:

WWV_FLOW.g_excel_format = true

And that’s it. You can see an example here: http://apex.oracle.com/pls/otn/f?p=666666:4

Advertisements
Categories: ApEx
  1. komeny
    November 14, 2011 at 3:57 pm

    Hello, I have tried your example, and it shows every column for me.
    What can be the problem?

  2. Logaa
    July 14, 2009 at 9:43 am

    hi andy..
    i have searched many forums to get this trick.. thank you for sharing this information. i need this for my project application..
    thank you once again….
    waiting for your next trick on apex

  3. sahil
    June 13, 2008 at 11:10 am

    Hi, i didnt get where to put the above 2 conditions?
    Where is this condtion type which u r talking abt?

  4. James
    November 14, 2007 at 8:46 pm

    Hi,

    I am looking for checkbox group control on Hide/Show columns. Any tricks you guys know of? Thanks.

    James

  5. May 18, 2007 at 7:33 pm

    Hi Kris,

    you can also use the REQUEST to show/hide a column. See Sergio’s tip at http://www.orablogs.com/sergio/archives/001873.html

    But your solution looks cleaner.

    Patrick

  6. Duncan
    March 28, 2007 at 7:57 pm

    Thats a neat trick Andy. Thanks for sharing. Duncs

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: