Hi,
I do not know anything about JavaScript, but need to learn enough to create some calculation scripts for an excel spreadsheet that converted into a pdf form with fields.
I made one version from the wizard and that didn't work(I thought the functions would transfer over) and then created another one individually by hand. Is one better than the other?
There are 12 columns of 30 fields. Each column needs to be added. I was able to accomplish this by adding a 31st field to each column called 130SUM, 3160SUM etc.. at bottom of each column and adding a predefined calculation: In Text field properties/Calculate Tab I used the predefined " Value is the Sum+" then picked the individual fields in each column to add.
I then created another " Value is the Sum+" field property that calculates the sum of all of the 12 SUM fields and picked those SUM from the list. This all works great!
However, I have another field that needs to calculate the count of the fields that have numbers entered into them of the 360 fields. I HAVE NO IDEA HOW TO DO THIS???
Finally, I need to get the average of all the amounts entered into the 360 fields (not all the fields are always used). I used the predefined " Value is the /average" which would work fine, but it adds all 360 fields and not all of them are used, but it still adds "0" to the total and then divides field by 360.
So I believe I will need to write a custom script for the "count" and the average of fields entered, and whether I need to write a custom script for the others as well since they are affiliated with the other two equations. And when I write these scripts, do I need to list out each of the 360 fields, or can I use a shortcut like in Excel its =Average(B8:M37).
I did look at other forums in here, but really not sure where I should start to get this task accomplished. Any help or guidance would be appreciated!
I need to know where I can find information on what I need to learn without starting from square one in Acrobat Javascript Calculating for Dummies. I hope I articulated my questions well. Thanks in advance for any help!
http://w3schools.com/jsref/jsref_obj_math.asp
To calculate the average you can use a script like this (let's say you have 30 fields and the sum is saved in a field called "130SUM"):
Basically, it all depends on how you named your fields. If they are named consistently, like "Field1" to "Field360", then it becomes easier. In that case you can use something like this:
This will be the custom calculation code of your counting field.
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com