Skip navigation
Zayed_Stell
Currently Being Moderated

Getting the sum of variable rows (rows number is unknown)

Aug 15, 2012 1:24 AM

Dear All,

I need to create a script with the option for addidional raws (Dezimalfelde2 +Dezimalfelde3+..... ) the total sum should include all future raws…

How can I create it? Please see above the below javascript…I tried to write (Dezimalfelde2[*]) just to indicate all fute rows but its not working!

 

plz help ?

 

1.png

 
Replies
  • Currently Being Moderated
    Aug 15, 2012 8:04 AM   in reply to Zayed_Stell

    Moin,

     

    the accessor is placed at the wrong place.

    There is only one "Dezimalfeld2" in each row so you don't need the [*] accessor here.

    But the row "detail" is repeating, so here is the place you should use it.

     

    var total = 0;
    var fields = xfa.resolveNodes("Tabelle4.detail[*].Dezimalfeld2");
     
    for (var i = 0; i < fields.length; i += 1) {
        total += parseInt(fields.item(i).rawValue);
    }
    this.rawValue = total;
    
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points