Page 1 of 1

How i can get the value from text

Posted: Fri Aug 05, 2016 12:10 am
by Fmotta
Hello,

I need to make a calculation based on the result of a sum. I created a Text called Text1, then put in the detail band to make the sum of a group {Sum (databand1, myreport.name)}. I created a variable of type Percent and Add a line in after print event, put the variable to receive the value that was printed in Text1. It was so in print after: myVariable = Text1.Text
This not work. How i get a value from Text ?

Rgds,

Re: How i can get the value from text

Posted: Fri Aug 05, 2016 8:01 am
by HighAley
Hello.

It's not so easy to get data from text components. There are component on report template and on rendered report. Usually there are many instances of one component on the rendered report.
It's better to use the same expression. Or use variables to save data there.

Thank you.

Re: How i can get the value from text

Posted: Fri Aug 05, 2016 10:45 am
by Fmotta
Please, show me an exemple.

Re: How i can get the value from text

Posted: Fri Aug 05, 2016 10:48 am
by Fmotta
I have tried to put the same expression and did not work in the example below.

myvariable = {sum(databand1, myreport.name)}

Re: How i can get the value from text

Posted: Fri Aug 05, 2016 12:36 pm
by Alex K.
Hello,

Please try to use the following expression in the Text expression:

Code: Select all

{Variable1 = Totals.Sum(Products, Products.UnitPrice)}
or in the BeforePrint event:

Code: Select all

Variable1 = Totals.Sum(Products, Products.UnitPrice);
Thank you.

Re: How i can get the value from text

Posted: Fri Aug 05, 2016 1:27 pm
by Fmotta
My text no use a field database, use a expression (sum....)

Re: How i can get the value from text

Posted: Fri Aug 05, 2016 2:23 pm
by HighAley
Hello.

Sorry, maybe we don't understand your issue right.
Could you describe it more detailed?

Thank you.