Skip to Content
avatar image
Former Member

Subtotal on each page for a value

Hello together,

i hope somebody can help me.

I need a subtotal of all value on each page.

I have this structure


- Subform_item



- Footersubform


i have for example 3 Pages on page one i have 3 positions on page 2 and 3 5 positions with some price value.

Now i will subtotal of page 1 at the end witch containe my 3 pricevalues from page1

Then i will a subtotal on page 2 which containe the subtotal of page 1 and the sum of the pricevalues from page 2-

On Page 3 i also need a subtotal which contain the subtotal from page 1 & 2 and the pricevalue of page 3.


pricevalue 10,11

pricevalue 10,12

pricevalue 10,13

--subtotal = 30,36


pricevalue 4,00

pricevalue 4,00

pricevalue 2,00

pricevalue 2,00

pricevalue 2,00

subtotal = 44,36


pricevalue 1,00

pricevalue 1,00

pricevalue 1,00

pricevalue 1,00

pricevalue 1,00

subtotal = 49,36

I have a footer subform with a field subtotal

and there i try to calculate it.

I try some different examples, but nothing works correct.

This is my last try, but doesn't calculate what i want 😊

var fields = xfa.layout.pageContent(, "field", 0);

var total = 0;

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

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

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



this.rawValue = total;

Thanks in advantage for some help.

Best regards


Edited by: Florian Martin on Sep 20, 2011 2:38 PM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Sep 20, 2011 at 12:45 PM

    Hello Florian,

    the code which you have written will calculate subtotal of that page.

    remove total = 0; just declare the variable.

    if you want to initialize the total variable, do it in initialize event



    Add comment
    10|10000 characters needed characters exceeded

    • Hello Martin,

      one small question to the calculation of the subtotal.

      Which event where the Javascript coding are stored should be used for the calculation ???

      Thanks in advance and kind regards