use the value of textbox in another text box

Stimulsoft Reports.WEB discussion
Post Reply
dorsa2
Posts: 8
Joined: Mon Apr 15, 2019 6:23 am

use the value of textbox in another text box

Post by dorsa2 »

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?!
cbrydon
Posts: 173
Joined: Fri May 30, 2014 4:37 pm

Re: use the value of textbox in another text box

Post by cbrydon »

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
Lech Kulikowski
Posts: 6237
Joined: Tue Mar 20, 2018 5:34 am

Re: use the value of textbox in another text box

Post by Lech Kulikowski »

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.
Post Reply