Get the product or sum from one text box's expression into another

Posted by: joakimsinbox on 25 December 2020, 3:42 am EST

  • Posted 25 December 2020, 3:42 am EST

    I'm looking for a solution on how to use the product or sum from one textbox's expression in another textbox's expression.
    I need it to work in a section report and without using a script.

    If I were to solve this in excel I would simply refer to another cell ie "...+A7" in my formula. But in the section report I don't understand how to make this reference.

    Thanks for any help!

  • Replied 27 December 2020, 1:32 pm EST

    Hello,

    It is not possible to achieve the same in SectionReports without Script. Could you please share the reason, why you don't want to use the Scripting in the SectionReport?

    Also, it can be achieved in Page/Rdl report if you want to migrate from SectionReport.

    Thanks,
    Mohit
  • Replied 27 December 2020, 9:58 pm EST

    Thank you!
    Neither me or my end users have any experience using script. But if that is the only way I'd like to give it a try. I will not be able to migrate to page/rdl.

    What's needed to get the sum of Textbox1 and Textbox2 in Textbox3? I can find limited instructions on how to get myself started with this. Could you please refer me if there are examples or instructions to find?

    Joakim
  • Marked as Answer

    Replied 28 December 2020, 2:25 pm EST

    Hello,

    You can refer to the following link to know more about scripting and section report events:
    https://www.grapecity.com/activereportsnet/docs/v15/online/scripts.html
    https://www.grapecity.com/activereportsnet/docs/v15/online/report-events.html
    https://www.grapecity.com/activereportsnet/docs/v15/online/using-script-in-section-report.html

    To achieve your requirement, you can use the Detail Format event in scripting and use the following code:
    public void Detail_Format()
    {
    this.TextBox3.Value = int.Parse(TextBox2.Text) + int.Parse(TextBox1.Text);
    }


    If you are facing any issue while using scripting, please let me know.

    Thanks,
    Mohit
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels