Istaley February 2016

the hidden expression for table contains an error: Object variable or with block variable not set

I am trying to hide an SSRS column based on the ReportServerURL. If it is on site A it will be hidden but if it is on Site B it will be shown. This is the expression that I am using in the Column Visibility property. =IIf(Globals!ReportServerUrl.IndexOf("devrxanalytics") >= 0, false, true)

The problem is that it works once it is deployed to either sharepoint site, but when I try to view it in Visual Studio under preview, I get the following error:

the hidden expression for table contains an error: Object variable or with block variable not set

Not a big deal since it works on the site but how would I resolve this so that I may view the report in Preview mode?

Answers


alejandro zuleta February 2016

Try this:

=IIf(ISNOTHING(Globals!ReportServerUrl) OR
Globals!ReportServerUrl.IndexOf("devrxanalytics") >= 0, false, true)

This expression performs the following logic, if ReportServerUrl global variable is null (report generated from visual studio) or ReportServerUrl contains devrxanalytics, don't hide the column.

Let me know if this helps you.

Post Status

Asked in February 2016
Viewed 3,391 times
Voted 11
Answered 1 times

Search




Leave an answer