Nested conditional statements

Stimulsoft Ultimate discussion
Post Reply
David334
Posts: 29
Joined: Tue Jul 16, 2019 6:45 pm

Nested conditional statements

Post by David334 »

I had a report using nested conditional statements with the format " condition ? true : false "
It looked something like:
{condition ? "Text_if_True" : New_Condition_If_False ? "Text_if_true" : "Text_If_False"}

This was working fine up until a current upgrade in software that uses stimulsoft reports, and now the reports are not working with this.
When I check the syntax I get "Syntax Error - Unprocessed lexemes remain"

I managed to get it to work using the {IIF(,,)} format, but I prefer the { ?: } format as its a bit cleaner.

Did something change and the { ?: } method no longer works when trying to next statements?

Thanks.
Lech Kulikowski
Posts: 6196
Joined: Tue Mar 20, 2018 5:34 am

Re: Nested conditional statements

Post by Lech Kulikowski »

Hello,

Please check the following expression:
{(condition ? "Text_if_True" : (condition ? "Text_if_true" : "Text_If_False"))}

Thank you.
David334
Posts: 29
Joined: Tue Jul 16, 2019 6:45 pm

Re: Nested conditional statements

Post by David334 »

Thank you. I see my problem with the parenthesis. Your example works, Thanks.
Lech Kulikowski
Posts: 6196
Joined: Tue Mar 20, 2018 5:34 am

Re: Nested conditional statements

Post by Lech Kulikowski »

Hello,

You are welcome.
Post Reply