Reputation: 775
I am using SSRS 2012, and Excel 2010, I want to hide a column when Exporting to Excel, after looking through some of the forums it seems the best way to do this is by going to the Column or Text box of what you are looking to hide and under the Visibility/Hidden option set the Expression to be :
=IIF(Globals!RenderFormat.Name = "EXCEL",true,false)
I have tried this and for some reason it doesn't work, however if I reverse the options of true and false I can get it to hide the column in SSRS but it also hides this in Excel. Could this be an issue because of the version of Excel I am using?
Upvotes: 3
Views: 2202
Reputation: 1124
Because you are returning a boolean you do not need the IIF:
=Globals!RenderFormat.Name = "EXCEL" or Globals!RenderFormat.Name = "EXCELOPENXML"
or this is also valid:
=InStr(Globals!RenderFormat.Name,"EXCEL") > 0
Upvotes: 0
Reputation: 39566
In SSRS 2012 the XLSX export format was introduced, which uses a different renderer than XLS exports.
So I wonder if this is causing the issue. Modify the visibility statement to consider both export formats, something like:
=IIF(Globals!RenderFormat.Name = "EXCEL" or Globals!RenderFormat.Name = "EXCELOPENXML"
,true
,false)
This seems like a good first test.
Upvotes: 3