Expand my Community achievements bar.

Autosum function does not work in the generated pdf

Avatar

Level 2

I would like to make an autosum from prices in an drop-downlist.

In livecycle designer the function will work but when i make an pdf, the function will not work

anymore. What can i do?

14 Replies

Avatar

Level 10

Hi,

please provide more information.

How does your function look like and how is you form builded?

Avatar

Level 2

Hi,

I used this function:

 

$

= Sum(bedrag1[*])

Bedrag is the name of the dropdownlists. In this dropdownlist the prices of products

can be selected. At the end i will see the total of this productprices.

Avatar

Level 10

How do the prices look like in you DDL?

Did you use a currency symbol?

Avatar

Level 2

In the ddl the prices look like this: 0,00 / 7,50 etc

i did not use any currency.

Only in the totalfield i set a display pattern. The total of the prices will be displayed in €

Is it possible to send you an example of the form?

Avatar

Level 10

Just upload the file somewhere in the www like Acrobat.com and post a link here.

Avatar

Level 2

I uploaded the file to Google Drive. Download it with the bit.ly link.

http://bit.ly/ZdkfIJ

Avatar

Level 10

Ok,

you need to change your script a bit because you have grouped all your DDL's.

Use:

$= Sum(xfa.resolveNode("#area.bedrag1")[*])

Avatar

Level 2

Thanks for your answer, but when I change the script and save as pdf the autosum does not work.

http://bit.ly/12IdYKc

Avatar

Level 10

I don't see a problem.

The Totaal fields sums the values selected in the DDLs above.

Make sure you have selected "Interactive Form" as preview type in you form properties.

Sum.png

Avatar

Level 2

Strange. Everything looks like you say, but at my computer it does not work.

https://workspaces.acrobat.com/?d=Xa*cH73CxNcPmiA-YZg7kQ

This is the .tds file. Can you please have a look?

Avatar

Level 10

I cannot access the file, you propably forgot to share it.

Anyway, do other scripts work or is JavaScript deactivated in your Acrobat/Reader?

To run script (FormCalc or JavaScript) your PDF-viewer has to support JavaScript.

Avatar

Level 2

Other script work in Acrobat Reader and Javascript is activated.

I shared the file. Now it must be possible to download the file.

https://workspaces.acrobat.com/?d=Xa*cH73CxNcPmiA-YZg7kQ

Avatar

Level 10

There is still not problem at my end, sorry.

You can try to remane the group into "Prijs" for example, then the script will be shorter. For me it also worked.

$ = Sum(Prijs.bedrag1[*])

Avatar

Level 2

I know what the problem is. When i use a dot instead of a comma in the prices the function will work.

Strange is that the total will be display the price as 2,50

Do you think it is possible to use the prices as well with a comma instead of an dot? This is the standard in the Netherlands.