SSRS 2008 Hidden property for TextBox evaluates to true, exports to CSV anyway

Go To


I have a a column in a report that has it's visibility controlled by an expression.

=IIF(UCase(CStr(Fields!Condition.Value)) = "C",True,False)

When the condition is true, the column hides, when it is false, the column is visible. When I export to Excel and PDF, the rendered respects what this expression evaluates to, and shows the column appropriately.

CSV on the other hand, exports the column no matter that the condition evaluates to. I have tried placing this expression in the column visibility, textbox visibility and a bunch of other places. It doesn't matter where I put it, CSV exports it.

I know you can supposedly control the CSV output with the RenderFormat.Name = "CSV", but that seems like an all or nothing approach. I need it to sometimes to export to CSV and other times not. I really just need this expression to work.

Is this a defect in SSRS 2008 and just simply not possible?

2012-04-03 23:16
by user961714


CSV export is handled quite a bit differently than most SSRS exports: Most of the rendering instructions are ignored. It's considered a "Data Export" not a rendered output.

But the "DataElementOutput" property for the text cells will control whether a cell's contents are placed in the .csv (Textbox Property pane -> Data Only section -> DataElementOutput)

2012-04-04 14:12
by Jamie F
Hi Jamie F, I have taken a look at that property. It looks like it is another "All or nothing" situation. Is this correct? IE, there is no way to conditionally affect the value of this property - user961714 2012-04-04 14:31
Yes, correct. This property can't be set dynamically. I haven't tried, but you could probably change the content of the cell with the RenderFormat.Name to substitute in an empty string, but you'll still get the field.

.csv export is designed to have a very stable set of fields exported, so that it can easily be used as an input to automated tools like SSIS - Jamie F 2012-04-04 14:38

Thanks for your help Jamie - user961714 2012-04-04 15:53