Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide Column in SSRS

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?

like image 906
PJD Avatar asked Apr 15 '26 15:04

PJD


1 Answers

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.

like image 126
Ian Preston Avatar answered Apr 17 '26 08:04

Ian Preston



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!