Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS Export to Excel Hide/Unhide Issue

Tags:

ssrs-2008

I have an SSRS 2008 report where in I have to hide some columns & export to excel and after exporting to excel, the requirement says that the columns should be unhidden in the excel. Please suggest a way to do this as I heard this can't be dont at all.

Thanks in advance!!

like image 913
Novice SSRS Developer Avatar asked Dec 10 '22 07:12

Novice SSRS Developer


2 Answers

It can be done, but I believe only when deployed to a SSRS 2008 R2 Server. That is how I am using it now. The way you do it is you use a conditional "Hidden" property on the columns that is set to the following: EDIT: switched the true false around so that it is not hidden in Excel

=IIF(Globals!RenderFormat.Name = "EXCEL",false,true)

That will effectively hide the column unless it is outputting in Excel.

You access the columns if you are using VS2008 by selecting advanced mode on the top right drop down of the group explorer near the bottom of the interface. The columns will list top to bottom representing left to right representation of the columns. Set the "Hidden" property with one of those selected.

like image 155
Frank Pearson Avatar answered Jan 10 '23 10:01

Frank Pearson


It is possible! :)

You just have to select the columns that you want to hide in excel, go to the properties panel (you can press F4) and at the bottom, inside visibility, write this expression in the Hidden option:

=IIF(Globals!RenderFormat.Name = "EXCELOPENXML",true,false)

Even if Visual Studio underlines the 'name' attribute in red, it works fine!

You can hide everything that you want in Excel, but it has to be rendered first in the RPL. Actually, when you hide it, it just appears like a white column.

like image 22
Carlos Sirvent Avatar answered Jan 10 '23 10:01

Carlos Sirvent