Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 

 View Only
  • 1.  Remove Column Header in Cognos Report When Export to CSV

    Posted Sun April 02, 2023 10:49 PM

    Hi all,

    We are using IBM Cognos Analytics with Watson (11.2.0).

    I wanted to remove the column header when running the report. So far I managed to hide the column header and when run as Excel the column header is removed. But when I run as CSV the column header changed to empty row. Is there a way to remove this empty row when run as CSV?

    Attached is my sample output on HTML, Excel and CSV.


    Run as HTML


    Run as Excel

    Run as CSV



    ------------------------------
    Mohamad Aiman Arif Mohamat Saat
    ------------------------------


  • 2.  RE: Remove Column Header in Cognos Report When Export to CSV

    Posted Mon April 03, 2023 01:21 AM

    Hi Mohamad, 

    There are two ways to do this. 

    1) If you want to hide the header in some formats but want to display in some other formats, then you can use render variables and reportOutput() function to achieve this. 
    2) If you want to hide it in all exported formats, then set the style of the header block in Properties to Don't Print. 

    Regards,



    ------------------------------
    Kiran Passumarthi
    www.linkedin.com/in/kiranpassumarthi
    ------------------------------



  • 3.  RE: Remove Column Header in Cognos Report When Export to CSV

    Posted Mon April 03, 2023 02:13 AM

    Hi Kiran,

    For option 1, can you elaborate more especially on how to specify the render variable to only applicable to the list header?

    From my trial and error I can only create a conditional block and put the list inside the block. Lets say my render variable is reportoutput()='CSV', then the whole block (list body and header) will disappear for other format.


    For Option 2, I try just now and it works! Is there a way to remove the empty first row instead of just blank?


    Run as Excel


    Run as CSV



    ------------------------------
    Mohamad Aiman Arif Mohamat Saat
    ------------------------------



  • 4.  RE: Remove Column Header in Cognos Report When Export to CSV

    Posted Mon April 03, 2023 03:00 AM

    Hi Mohamad, 

    I misread it to be the report header and not the list header. 

    Looks like depending on the version you are using, even the second option may or may not work; I am on 11.1.7 and second option doesn't work for me and csv always displays the column titles. I found this technote. 

    https://www.ibm.com/support/pages/hide-column-titles-when-exporting-report-csv

    Regards



    ------------------------------
    Kiran Passumarthi
    www.linkedin.com/in/kiranpassumarthi
    ------------------------------



  • 5.  RE: Remove Column Header in Cognos Report When Export to CSV

    Posted Mon April 03, 2023 09:34 PM

    Hi Kiran,

    I did try the link you share but the result is almost the same. If I run as excel the table list header is gone while when I run as CSV the table list header is changed to empty row.


     I feel like we are missing another step or two for this but cant figure out where or how. Btw appreciate your help!



    ------------------------------
    Mohamad Aiman Arif Mohamat Saat
    ------------------------------



  • 6.  RE: Remove Column Header in Cognos Report When Export to CSV

    Posted Thu April 13, 2023 12:34 PM

    Hi Mohamad,

    there seems to be another approach to solve your problem, see: https://www.ibm.com/support/pages/node/6522986

    Hope this helps, regards



    ------------------------------
    Gertrud Lohwasser
    ------------------------------



  • 7.  RE: Remove Column Header in Cognos Report When Export to CSV

    Posted Thu April 13, 2023 11:18 PM

    Hi Gertrud,

    I try the link just now and it works!.

    Thank you!



    ------------------------------
    Mohamad Aiman Arif Mohamat Saat
    ------------------------------