I\'m using SSRS 2012 trying to do the following:
Some columns should only be visible on user request, using a combo box. Visibility of the columns dependes on the select
There is a native way to hide data elements sent to CSV by using DataElementOutput=NoOutput
Open the properties menu (F4) for the TextBox
Set the DataElementOutput
property to NoOutput
When SSRS has to render a chart, it has a couple of decisions to make. If you spent a lot of time doing some cool formatting, it will try to preserve that when going to PDF because PDF documents are full of rich formatting. For example, if you set the margins of the report, a PDF should care, but a CSV has no way to even hold that information (nor should it).
As such, there are different rendering engines used by SSRS:
Each of these has their own process. The data exports, for example, will only pull information from datafields. For example, a data field is welcome to have several layers of headers, the names of which may or may not use CLS-compliant identifiers, so it's safer to extract that information directly from the textbox name itself.
The TextBox containing the data can be used to set other data export properties as well.
In this instance, you can remove a particular data field by using the DataElementOutput which:
Indicates whether the data point should appear in a data rendering.
CSV (and XML) export from SSRS is treated very differently than most export formats. These two are considered data renderers, not page renderers, and are generally written to get at the data underlying the report, disregarding layout options. Part of this is that field visibility isn't handled the same way. I don't know if it's a bug or intentional design, but .CSV apparently doesn't honor visibility set in expressions. One suggested work around is to conditionally set the value to null
in the underlying dataset. (This could be based on a parameter.)