SSRS: Conditionally hiding columns based on parameter values – CSV export ignores

reporting-services

I have a simple table based report in SSRS 2008, There are 10 columns and each column has a corresponding parameter to determine whether the column should be shown. I achieve this by setting the Column Visibility option you get when right clicking on the column header in design mode. In my case I choose to 'Show or Hide based on an expression' to which I set the expression to the value of a parameter which is a boolean type.

The functionality works as expected during the initial render however when I choose to export the report to CSV the visibility expression is either ignored or not evaluated because the columns show up regardless of the setting.

The visibility dialog has three options, Show/Hide/Show Or Hide based on expression – If I explicitly set Hide option the CSV export does not include the column as you would expect however if I use an expression it will – I even went so far as to make the expression explicit like '=True' and still it was ignored.

How do I get the export option to evaluate this properly?

Best Answer

Here's a solution by KarenH in the article Hide/Show Items Dependant On Export Format

Basically, you can set the DataElementOutput = NoOutput on the control you want to hide.

This worked for me to hide tables when exporting to CSV.

screenshot

Related Topic