0
votes

I am looking at hiding a table in the report and not show during export to CSV based on a parameter. If the parameter is true, it should hide it in the report and export to CSV.

When I hide the table only in the report it works.

=iif(Parameters!parameter.Value=parameter_to_hide,True,False)

If I add the option of hiding the table in the report and in export to CSV, it does not work.

=iif(Parameters!parameter.Value=parameter_to_hide,Globals!RenderFormat.Name = "CSV",False) AND iif(Parameters!parameter.Value=parameter_to_hide,Globals!RenderFormat.Name = "CSV",False)

I also tried with no luck

=iif(Parameters!parameter.Value=parameter_to_hide,IIF(Globals!RenderFormat.Name = "CSV", True, False),False)

Any help would be appreciated

1

1 Answers

1
votes

Unfortunately, you cannot hide a table in a CSV export.

PDF, HTML, and Excel export leverage “layout renderers” – a generally more expensive export process which attempts to mimic the “look” you created in Report Designer. CSV and XML are “data renderers”, and only care about data. The difference is reflected in what a layout renderer typically exports (basically everything) and what data renderers save (not necessarily all of your columns).

--MSDN Blogs

There is a DataElementOutput property but you cannot set it with an expression (thanks, MS), so you would need to manually set it.

The only way I can think of around this is to have an IIF in every cell and display a blank if it's a CSV.