3
votes

I am trying to hide two textboxes from my DrillDown Report when exporting to excel but with no luck.

enter image description here

I also add expression to the visibility property of each textbox as below but still doesn't work:

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

as well as

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

The two textboxes "ExpandAll" and "CollapseAll" are being used just to refresh the same report with a parameter to expend/collapse the rows in the drilldown report which are not necessary to be shown in excel when being exported.

Any help would be very appreciated.

Ref: MSDN: Changing Reports at Run-Time

Ref: MSDN: RenderFormat

2

2 Answers

2
votes

I believe your second expression is correct,

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

Make sure the Action property after you click on ExpandAll or CollapseAll actually points to the same report/same URL/same directory as your current one. For eg,

"http://localhost/ReportServer/MyReports/MyReportName"

enter image description here

1
votes

For SSRS in 2012, the correct syntax would be:

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

They cleverly changed it for the 2012 edition.

FWIW, your 2nd attempt had , false, true ) where it should be , true , false ) . This is a really unintuitive property in SSRS, the UI calls it Visible but the actual property is Hidden, so everyone always gets confused ...