on 02-12-2014 2:43 PM
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.
hi Javier
can you explain me what are these values
1
2
3
corresponding to Table 1
and
10
4
Corresponding to Table 2
?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.