Page 1 of 3

adding two values from two textboxes

Posted: Fri May 19, 2017 11:15 pm
by ddsmith99301
I have two textboxes on the report. I would like to add the two numbers and put the total in a third textbox. How do I do it?

Re: adding two values from two textboxes

Posted: Sun May 21, 2017 8:09 pm
by Alex K.
Hello,

You can use expressions from first and second text component in the third textbox:
{Text1expression + Text2expression}

Thank you.

Re: adding two values from two textboxes

Posted: Tue Jul 23, 2019 8:58 pm
by shiva
To understand better is the above solution valid even if the expressions which are being added are like sumif{} derived by using summary.

Re: adding two values from two textboxes

Posted: Thu Jul 25, 2019 7:58 am
by Lech Kulikowski
Hello,

You can use an additional variables in text expression where sumif are used:
{Variable1 = SumIf()} {Variable2 = SumIf()}
and then use
{Variable1 + Variable2}

Thank you.

Re: adding two values from two textboxes

Posted: Tue Dec 27, 2022 3:49 am
by ddsmith99301
Lech, please give an example of where to set the two variables and when to use them. I have a group band and a databand. I put textboxes in the group band with expressions that use Sumif. I would like to use the two variables added to gather to put in the third textbox.

Re: adding two values from two textboxes

Posted: Tue Dec 27, 2022 8:15 am
by Lech Kulikowski
Hello,

Please check the sample report.

Thank you.

Re: adding two values from two textboxes

Posted: Thu Dec 29, 2022 5:18 am
by ddsmith99301
I tried everything to get this to work. I can't figure out what I am doing wrong. Why is the text box output 'False' where I am trying to set the VB2 variable?

Here is the designer.
2022-12-28_21-23-27.png
2022-12-28_21-23-27.png (129.62 KiB) Viewed 1221 times
Here is the output.
2022-12-28_21-17-55.png
2022-12-28_21-17-55.png (27.45 KiB) Viewed 1221 times

Re: adding two values from two textboxes

Posted: Thu Dec 29, 2022 8:05 am
by Lech Kulikowski
Hello,

What script language is used for the report? Please try to set it to CSharp.

Thank you.

Re: adding two values from two textboxes

Posted: Thu Dec 29, 2022 4:39 pm
by ddsmith99301
I found the option to change to c# script. That seemed to have worked. So, my conclusion is the vb scripting doesn't work. I am using ver 2019.3.1. Has that been fixed in later versions?

Re: adding two values from two textboxes

Posted: Thu Dec 29, 2022 5:30 pm
by ddsmith99301
I said before that it worked but there is a cost. Now I have 300+ errors!