In SQL Server Reporting Services, how do I display hidden columns when printing or downloading as a file (csv, pdf, etc.),
I have a situation where I need to hide the columns of a report when viewed, but when printed or downloaded as a file, these hidden columns should be visible. Hiding columns is not a problem, simply because I cannot figure out a way to show hidden columns when printing / loading.
I don't want to create 2 separate reports for this.
thanks
a source to share
What I do in these situations is to create a parameter for the report that says something about the effect of "Show hidden columns"? or "Show printable version?" and then wire the Column Visibility property to this parameter. Yes, they might have to run the report again, but that prevents you from making a separate report yourself.
a source to share
Select the column and in the Column Visibility field select Show or Hide Based on Expression and select the fx formula-expression button. The group heading will say "Set expression for: Hidden"; write expression = Globals! RenderFormat.IsInteractive OR select from UI under Render Fields.
a source to share
There is no built-in functionality to hide columns only when viewing a report in a browser. Reporting Services provides a report in the same way, regardless of whether you save or print the report. It does not matter.
The only way to achieve what you want is either:
- create a new report
- (as mentioned by Dave) a parameter that controls the hiding of columns
Regardless of when you actually generate the print / save report it will look identical on screen
a source to share