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

Table Sums

AdobePPLD
Registered: Jun 20 2007
Posts: 4

In Adobe Livecycle Designer 8, I am creating a simple table that allows users to enter dollar amounts that total beneath the cells. I can easily create Numeric Field boxes and use FormCalc “Sum(NumericField1,NumericField2) for example in a Numeric Field to get the sum. However, when I create a Table, change the cells to Numeric Fields and use the same formula in a Table I get the following error when going to Preview PDF.
 
Script failed (language is formcalc; context is
xfa[0].form[0].form1[0].#subform[0].Table1[0].FooterRow[0].Total[0])
script= Sum(NumericField1,NumericField2)
Error: accessor ‘NumericField1’ is unknown.
 
What would be different about using a Table? Is there an easier way to get a sum in Table? I would think using a table to get a sum should be a relatively simple thing.
 
Thanks

My Product Information:
Acrobat Pro 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Well the message seems pretty specific. It can't find "NumericField1". Actually it can't find "NumericField2" either, it just hasn't gotten that far.

Designer 8 isn't real smart about creating tables. When I've used tables I usually redesigning them to better fit the form architecture I want to avoid awkward programming.

Designer puts each form field in a separate table cell, or subform. This means that you have to use a subform identifier on your field names. The full name has to be traceable through the hierarchy from the location of the script to the location of the field. This is called the SOM path (scripting object model). Take a look at the XFA SOM reference. It's on this page

[url=http://partners.adobe.com/public/developer/xml/index_arch.php]http://partners.adobe.com/public/developer/xml/index_arch.php[/url]


There are also ways to use wild cards and to acquire lists of fields. For example, for doing a sum for the whole table. SOM

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