on 06-30-2010 3:45 PM
Hello,
I am creating an Adobe form for SD invoices.
I have a table which contains the list of invoice items. I want to calculate a sub total per page in the table footer.
For example :
PAGE 1
Item1 10,00 euros
Item2 10,00 euros
Item3 10,00 euros
Sub total : 30,00 euros
PAGE 2
Item4 10,00 euros
Item5 13,00 euros
Item6 22,00 euros
Item7 14,00 euros
Sub total : 59,00 euros
PAGE 3
Item8 23,00 euros
Item9 55,00 euros
Sub total : 78,00 euros
How can I calculate this ?
I have found this code on SDN but I don't know if it matches with my problem and I don't know how to use it ....Do you have an idea ?
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") {
total = total + fields.item(i).rawValue;
}
}
this.rawValue = total;
Edited by: Laure VERE on Jul 1, 2010 9:11 AM
Hi ,
Search for the function "sum" in formcalc in the "Adobe Livecycle Designer Help". That will solve your problem.
It is something like
var total = sum( TableName.RowName[*].FieldName[*])
Thanks,
Omkar Mirvankar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I f I were you, I would count the totals in backend. In-form scripting is troulesome, affect performance etc etc. If you insist, you can script this out, but I would count that in backend, send the ready-to-use values into the form and only display them there.
Otto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
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.