Page 1 of 1

Nested conditional statements

Posted: Fri Oct 15, 2021 6:14 pm
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.

Re: Nested conditional statements

Posted: Mon Oct 18, 2021 7:22 am
by Lech Kulikowski
Hello,

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

Thank you.

Re: Nested conditional statements

Posted: Mon Oct 18, 2021 7:34 pm
by David334
Thank you. I see my problem with the parenthesis. Your example works, Thanks.

Re: Nested conditional statements

Posted: Tue Oct 19, 2021 7:26 am
by Lech Kulikowski
Hello,

You are welcome.