Syntax question

Stimulsoft Reports.UWP discussion
Locked
Kwokhei
Posts: 4
Joined: Sat Jul 10, 2021 1:24 pm

Syntax question

Post by Kwokhei »

I have a report in below, the display value of Text37 in PageHeader will be changed depending on the value showing in Text8 in DataBand.

PageHeader1
Text37

DataBand1
Text8

How can I set in Text37 in PageHeader1, if Text8 is "A" show 'Successful' else 'Failed'?

1. I tried to set in Text37, {IIF(Text8.text=="a","Successful","Failed")}, but when I click the 'check' button, it will show 'Field, Method or Property not found:text",
Can you please advice how to fixe this?
Lech Kulikowski
Posts: 6196
Joined: Tue Mar 20, 2018 5:34 am

Re: Syntax question

Post by Lech Kulikowski »

Hello,

During the report, rendering exists two instances of each component (minimum two instances). One instance - component in the report template. Second instance - component which created the rendered report. During the creation of the second instance, report engine calculates expressions and write it to the second instance. When you write code like this:
Text23.Text = "test";
you call instances from report template which does not contain calculated values from expressions.

You can:
1. Instead of "{Text1.TextValue}" expression using the same expression as in Text1.Text property, or
2. Use variables. In this case, you can calculate value in variable, and then use this variable in expressions.

Thank you.
Locked