Eugene Berkovich
Eugene Berkovich

Reputation: 1

My visibility condition in SSRS caused "[BC30516] Overload resolution failed because no accessible 'IIf' accepts this number of arguments." error

I am using the following expression for a row visibility rule:

=IIF(Sum(Fields!bt_actual_usage.Value) > 0 
AND (Count(Fields!bt_actual_usage.Value) < Parameters!Consecutive.Value)), true, false)

When I try saving the report I get the following error message:

"The Visibility.Hidden expression for the tablix ‘Tablix1’ contains an error: [BC30516] Overload resolution failed because no accessible 'IIf' accepts this number of arguments."

I think I only have three arguments, as I should. What am I doing wrong?

I have also attempted to replace the IIF with something like this:

=IIF(Sum(Fields!bt_actual_usage.Value) > 0, true, false) 
AND IIF((Count(Fields!bt_actual_usage.Value) < Parameters!Consecutive.Value), true, false)

I got the same error.

Upvotes: 0

Views: 960

Answers (1)

Hannover Fist
Hannover Fist

Reputation: 10880

There's an extra closing parethesis at the end of the parameter value that causing the IIF to close with only one argument.

=IIF(Sum(Fields!bt_actual_usage.Value) > 0 
AND (Count(Fields!bt_actual_usage.Value) < Parameters!Consecutive.Value)), true, false)

Your working answer removed the opening parenthesis before the count and the TWO after the parameter.

Removing just one would have worked. This is why I try to use as few parenthesis as possible, but as many as needed.

=IIF(Sum(Fields!bt_actual_usage.Value) > 0 
AND (Count(Fields!bt_actual_usage.Value) < Parameters!Consecutive.Value), true, false)

Upvotes: 0

Related Questions