SSRS Export to Excel Hide/Unhide Issue
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开发者_如何学Python I heard this can't be dont at all.
Thanks in advance!!
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.
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.
If Excel 2012 is used , then please try this instead
=IIF(Globals!RenderFormat.Name = "EXCELOPENXML",true,false)
The formula below worked fine for this scenario - I want page breaks in report viewer, but while exporting I need all the rows data in single excel sheet.
=IIF(Globals!RenderFormat.Name = "EXCELOPENXML" OR Globals!RenderFormat.Name = "EXCEL", false, true)
No it can't.
Columns (or any data region) in SSRS that is not visible isn't rendered. It can't show in Excel because it isn't there.
From a user perspective, if I export I'd expect to get what I see on screen.
You could have a URLAccess based report that
- points back the same report
- has a hidden parameter RenderAllForExcel (
..&RenderAllForExcel=true
) - renders direct to Excel (
...&rs:Format=Excel&rs:Command=Render
)
精彩评论