These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Simple sum calculation

Shelley_Pickett
Registered: Jan 12 2009
Posts: 4

In Live Cycle,I created a table with 4 columns, the last column "amount" needs to be totaled on the last row.

I've spent all day trying to understand how to get the form to auto total using online help, etc.

I want to use the Sum(Amount[*]) function but can't get it to work.

I renamed each cell / object as "Amount" but I can't get the bind tab to count each cell / object systematically as Amount1, Amount2, etc.

Any help would be greatly appreciated.

Can I send you the form so that you can see what I've done?

Shelley

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
A LiveCycle (or XFA) form is controled through it's hierarchy, and this is something that tables have a lot of. The form hierarchy controls both the phyical layout of the form, and how the form is scripted.

Each element on the form is identified by it's SOM path. This is the list of element names that starts at the top of the form and goes thourgh all the levels of hierarchy until it reaches the element of interest. You can see the elements that make up the SOM path in Designer's Hierarchy window. You can also see each element's SOM path by opening the scripting window and then clicking on any form element. The SOM path will appear in the info line at the top of the scripting window.

To use the "Sum()" fucntion you have to write a SOM path that describes the location of all "Amount" fields from the position of the total field. For this, there is a document, The SOM path reference.

http://partners.adobe.com/public/developer/en/xml/som_2.0.pdf

Here's a helpful blog post:

http://blogs.adobe.com/lcdesigner/2007/11/a_shortcut_for_inserting_som_e.php

You're SOM path might look something like this

"Table.Rows[*].Cell[*].Amount"

But I don't know what the structure of the document is so I can't tell you for sure.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script