Reputation: 23
I have a situation where I need to hide columns of the report when viewing but when printing or downloading as a file, those hidden columns need to be displayed. Hiding the columns is not an issue, its just that I cannot figure a way to display the hidden columns when printing/downloading.
I do not want to create 2 separate reports for this.
Thanks
Upvotes: 2
Views: 1778
Reputation: 11
Select the column and On the 'Column Visibility' option, select 'Show or hide based on an expression' and select fx formula-expression button. The group heading will say "Set expression for: Hidden"; write the expression =Globals!RenderFormat.IsInteractive OR select from UI under "Build-in Fields".
Upvotes: 1
Reputation: 2152
There is no in-built functionality to hide columns only when viewing the report in the browser. Reporting Services renders the report the same way, whether you then save or print the report is of no consequence.
The only way to achieve what you want is to either:
Regardless when you actually generate the report for print/save it will look identical on screen
Upvotes: 0
Reputation: 97791
What I do in these situations is to create a parameter for the report that says something to the effect of "Display Hidden Columns?" or "Show Printable View?" and then wire up the Visibility property of the column to that parameter. Yes, they might have to run the report again, but it keeps you from having to do a separate report yourself.
Upvotes: 2