Script for Referencing a TextBox that has a Summary Function

Posted by: david.janssen on 6 April 2023, 4:17 pm EST

  • Posted 6 April 2023, 4:17 pm EST - Updated 6 April 2023, 4:22 pm EST

    Hello,

    Please forgive my lack of knowledge of coding. This is my first experience with this script.

    I am working on a report that was previously created in our company and am trying to add a textbox within the GroupHeader2 section to calculate a percentage based on other TextBoxes. I attached images of the Designer, Script, and resulting report of one way that I have tried. FYI This is Dtools System Integrator, which uses ActiveReport v10, VB.NET script.

    The subsystem level margin adjustment percentage (TextBox10) is calculating incorrectly because TextBox1 is a summary function of a dataset and is not populating fully in the TextBox10 expression.

    I have tried multiple options for the script from information I have gathered on this forum and others. It seems I need to reference the dataset directly instead of referencing TextBox1, but I do not know how to do that in script.

    If you can help in any way it would be greatly appreciated. Thank you

  • Posted 10 April 2023, 7:56 am EST

    Hi David,

    You can directly get the values from the Fields collection by either referring to the field using index value or the Field name see example code:

    var value = this.Fields["Price"].value;
    

    If you still face any issues in getting the values from the DataFields then please share the report file(.rpx) so we can reproduce this issue at our end and get back to you accordingly.

    Regards,

    Akshay

Need extra support?

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

Learn More

Forum Channels