How to store values with variables using IIF

Stimulsoft Reports.NET discussion
Post Reply
osched
Posts: 3
Joined: Wed May 08, 2013 10:08 am

How to store values with variables using IIF

Post by osched »

Hi,
I have defined an integer variable RowNumber in the report dictionary:
{IIF((Events.Name=="Failure"),RowNumber=Line,"Job OK")}
which should give the number of the last row of a datalist that fulfills the boolean expression. However, the true part is returned even when the boolean expression is false and the variable RowNumber always returns the last row number of my datalist. Should I declare a different variable or change its properties?

Thanks in advance.

Oscar
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to store values with variables using IIF

Post by HighAley »

Hello, Oscar.

The IIF() function works as any other C# function. If you call it all parameters are calculated. So it's better to use ternary operator (?:).

Thank you
Post Reply