none
Hide CSV columns conditionally in SSRS reoprt (RDL)

    Question

  • Hi friends,

    I want to hide some columns in my report conditionally using an expression when report is exported to CSV format.  Column and textbox visibility setting works fine in PDF and Excel format but it is completely ignored in CSV format.  There is no way I can conditionally hide a column in CSV.  Google search and few articles suggest that this is by design behavior of SSRS and even Microsoft has confirmed that.  Please check following links.

    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/f68c3dcb-4d3d-46ec-982e-c57ed2e4b64c/update-xml-and-csv-problem-in-ssrs-2008?referrer=http://social.msdn.microsoft.com/Forums/sqlserver/en-US/f68c3dcb-4d3d-46ec-982e-c57ed2e4b64c/update-xml-and-csv-problem-in-ssrs-2008?forum=sqlreportingservices

    https://connect.microsoft.com/SQLServer/feedback/details/431073/ssrs-programatically-controlling-the-dataelementoutput-property

    https://connect.microsoft.com/SQLServer/feedback/details/651316/ssrs-csv-xml-renderers-should-evaluate-hidden-expressions-for-dataelementoutput-auto

    I would like to know when this will be fixed by Microsoft or whether there is any workaround.  Please let me know.

    Regards,

    Murtaza

    • Edited by murtazat Sunday, November 10, 2013 8:52 PM
    Sunday, November 10, 2013 8:48 PM

Answers

  • Hi Murtaza,

    According to your post, I can reproduce the same issue in my test environment (SSRS 2012).

    Based on the thread your post, the XML and CSV renderers use the DataElementOutput property to control visibility. We can select which item we want to hide in the report, and set the “DataElementOutput” property with value “NoOutput” to work around the issue.

    Alternatively, we can add below expression to control the item’s visibility. Please refer to the expression below:
    =IIF(Globals!RenderFormat.Name="CSV",True,False)

    In order to solve the issue more effective, I recommend you that submit a wish to the Microsoft Connect at https://connect.microsoft.com/SQLServer/Feedback. Your feedback is valuable for us to improve our products and increase the level of service provided.

    Regards,
    Alisa Tang


    Alisa Tang
    TechNet Community Support

    Tuesday, November 12, 2013 2:40 AM
    Moderator