cancel
Showing results for 
Search instead for 
Did you mean: 

Subtotal at the end of subform

former_member622551
Participant
0 Kudos

Hello everyone,

I need your help with this issue.

I need a subtotal value at the end of a table. This table is inserted in a subform and could be shown more than one time in a page.

My requierement is a subtotal for each subform. Now I get this subtotal for each subform, but the value is not right because is the value of all the lines of the page, and I want the sum of the values only of each table.

Example.

Now

Page 1.

     Subform1

          Table 1      1

                          2              

                          3

           Subtotal   20  (Sum of all the lines of the page)

          Table  2      10

                            4

            Subtotal   20 (Sum of all the lines of the page)


What I want is:

Page 1.

     Subform1

          Table 1      1

                          2              

                          3

           Subtotal   6  (Sum of all the lines of the page)

          Table  2      10

                            4

            Subtotal   14 (Sum of all the lines of the page)


In the script code, I have write the next:

var fields = xfa.layout.pageContent(xfa.layout.page(this)-1, "field", 0);

var total = 0;

for (var i=0; i <= fields.length-1; i++) {

    if (fields.item(i).name == "PRICE_DIFFERENCE_TOTAL") {

        total = total + fields.item(i).rawValue;

    }

}

this.rawValue = total;

Could you help me please?


Thank you very much.

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

hi  Javier

can you explain me what are these values

1

2

3

corresponding to Table 1

and

10

4

Corresponding to Table 2

?

former_member622551
Participant
0 Kudos

This are the values in the example that I want to add to the subtotal.

Thank yout very much!