cancel
Showing results for 
Search instead for 
Did you mean: 

Adobe Livecycle: table in table, summing cell values

planteksz
Explorer
0 Kudos

Hi,

I'm pretty new to Adobe LiveCycle Designer and I have a requirement to sum up field values based on a condition for a form in ByDesign. The full requirement is to have only line 10 display (see below on picture) and summing up the Net values for the lower level items (so it would be 25 Euros, instead of 0 and the two other lines would disappear). For now, I would love if at least the summing option could work but I haven't had luck with that so far.

Here is the hierarchy of the form:

And here is how it looks like on the printed form:

What happens (as far as I understood) is that the tblTable is printed three times for the three lines. It prints that decHiddenNetAmount field with the amount. I tried to write a logic with a for loop in JavaScript but it wouldn't sum up, instead it runs three times. So my question: where should I put this logic so it would sum up the net values properly? Is there a way to save these values in a global variable and then sum them up? I tried searching everywhere if there is a hint on how to do this but I haven't found anything and also sorry if it's a very trivial question. Thanks so much if anyone can help!

Accepted Solutions (1)

Accepted Solutions (1)

planteksz
Explorer
0 Kudos

I managed to figure this out. First of all, it's very useful if you turn on the Dynamic XML preview under Form properties. Then it's also very useful to add the javascript debugging to Adobe Acrobat Reader since after that you can use app.alert() and basically that helps you debug things. After I managed to call the app.alert() I figured out that my starting logic was good and it was at the wrong place only. Also, it's possible to sum up all tables this way: xfa.resolveNodes("tblTable[*].rowItem.tblNetValue.rowNetValue.decHiddenNetAmount");

After I figured out all of these, I managed to make my logic work and it sums up the values.

Answers (0)