cancel
Showing results for 
Search instead for 
Did you mean: 

How to sub-totals in SAP Adobe forms?

Former Member
0 Kudos

Hi,

I am trying to subtotal a column in my table.I followed one of sap website tutorials.PRICE is myfield .For my subtotal text field this is the script.

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;

after this instead of displaying total value this is again display my first row value in subtotal box

Any thing wrong with the code?

Rgds

Vara

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

In the below link for example application , used sum of a column all values in the form. Import to ALD and see the java script code.

http://partners.adobe.com/public/developer/en/livecycle/designer/pdfs/InteractiveExpenseReport.pdf

other alternative method is, by doing Loop through the table.

Regards

Malli.

Former Member
0 Kudos

Malli,

Thank you for the info.

I am trying to javscript but when I select the text field and go to script editor and tried to select JAVASCRIPT from language but it is not allowing me to select instead I can use FORMCALC.

any idea what is going wrong here?

rgds

vara

Former Member
0 Kudos

Resolved by loop.

Rgds

vara