Wayne
Wayne

Reputation: 13

Hiding a column based on a parameter using an expression

I have been trying to hide a column in a 2017 SSRS Report and have tried several examples that I have found here on the site but getting errors with all of them.

Here is the expression I'm trying to fix:

=iif(Parameters!School.Label Like "*Middle*",False,True)

I have also tried Contains with the same error.

When clicking on Preview and selecting my parameters I get the following error:

An error occurred during local report processing. The Hidden expression for the tablix Tablix1 contains an error: Operateor 'Like' is not defined for type 'String()' and String "Middle".

enter image description here

Upvotes: 0

Views: 76

Answers (2)

Esat Erkec
Esat Erkec

Reputation: 1724

I think you should handle the NULL values so the following expresion will help you;

=IIF((IIF(ISNOTHING(Parameters!School.Label),"NULLValue",Parameters!School.Label)).Contains("Middle"),"False","True")

Upvotes: 1

Corwin
Corwin

Reputation: 26

Is your School parameter default value NULL? That might be a reason why it fails to evaluate. If it is, try setting some other default value for testing.

Upvotes: 0

Related Questions