How i can get the value from text

Stimulsoft Reports.NET discussion
Post Reply
Fmotta
Posts: 4
Joined: Thu Aug 04, 2016 11:59 pm

How i can get the value from text

Post 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,
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How i can get the value from text

Post 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.
Fmotta
Posts: 4
Joined: Thu Aug 04, 2016 11:59 pm

Re: How i can get the value from text

Post by Fmotta »

Please, show me an exemple.
Fmotta
Posts: 4
Joined: Thu Aug 04, 2016 11:59 pm

Re: How i can get the value from text

Post by Fmotta »

I have tried to put the same expression and did not work in the example below.

myvariable = {sum(databand1, myreport.name)}
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: How i can get the value from text

Post 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.
Fmotta
Posts: 4
Joined: Thu Aug 04, 2016 11:59 pm

Re: How i can get the value from text

Post by Fmotta »

My text no use a field database, use a expression (sum....)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How i can get the value from text

Post by HighAley »

Hello.

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

Thank you.
Post Reply