I have a Stimulsoft report. In one of the text box of the report I use this:
{Round(Div(MultipleMArkUnit.Column1,SumUnit.Column1),2)} to generate the value that I want.
now I want to use the value of this Textbox in expression and show the result in another text box.
I use the code below in the second text box, and I want if the value of text22 <11 return 1 else return 2 in the second textbox.
{IIF(Text22< 11, 1, 2)}
but when I want to see preview the report I faced this error:
The error of compilation
The error of compilation is found in the 'Text' property of the 'Text26' component:
Operator '<' cannot be applied to operands of type 'Stimulsoft.Report.Components.StiText' and 'int'
how can I do this truly?!
use the value of textbox in another text box
Re: use the value of textbox in another text box
One option would be to use the expression from Text22 in your second text box. Something like the following...
{IIF(Round(Div(MultipleMArkUnit.Column1,SumUnit.Column1),2) < 11, 1, 2)}
Cheers,
Carl
{IIF(Round(Div(MultipleMArkUnit.Column1,SumUnit.Column1),2) < 11, 1, 2)}
Cheers,
Carl
-
- Posts: 6243
- Joined: Tue Mar 20, 2018 5:34 am
Re: use the value of textbox in another text box
Hello,
During the report, rendering exists two instances of each component (minimum of two instances). One instance - component in the report template. Second instance - a 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.
During the report, rendering exists two instances of each component (minimum of two instances). One instance - component in the report template. Second instance - a 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.