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

Column Total (#days * daily total)*row(s)

tgaspard
Registered: Aug 17 2011
Posts: 15

I have an order form with columnns for:
qty
item
daily/weekly/montly rates
# of days/weeks/months
daily/weekly/monthly total (qty*rate)
and at the bottom daily/weekly/montly subtotals (#of days/weeks/months * daily/weekly/montly total)
 
The way my boss wants this to work is:
I enter a qty, say "4" and a daily rate, $500
In the DailyTotal field for that row, the calculation would be $2000
Later, if I add in a number of days, say 4
the calculation in the subtotal at the bottom would be $8000
 
Clear as mud?
 
I have the row calcs working fine, its the subtotal field Im having trouble with. It needs to both multiply the # of days by the dailytotal and all each row in the columm together.
 
I've tried:
 
sum (ToolOrderTable.Row[*].DailyTotal[*])*days
and other variations on this idea.
 
any help would be appreciated.
 
Thanks!

-tina

My Product Information:
LiveCycle Designer, Windows
tgaspard
Registered: Aug 17 2011
Posts: 15
this is for a rental order form, if that helps any.

-tina

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Are you getting any error messages when you open the "Preview" tab/view?

Are you getting any error message on the JavaScript Console?

Do the rows calculate correctly?

When you enter a set of values what is the result you get?

What did you expect to get?

Is there a constant difference?

Is the result when new data is added the expected result for the previously entered data?

George Kaiser

tgaspard
Registered: Aug 17 2011
Posts: 15
George,
I was getting errors, but did get it to work just now.

In the DayTotal cell, I put this script:

if(days == null) then
$.rawValue = qty*day
else
$.rawValue = (day*days)*qty
endif

Then I just added an additional numeric field outside of the table to give me the sum of the DayTotal column.

Not sure if this is the "right" way to do it, but it is working and giving me the results my boss wants to see.

-tina

tgaspard
Registered: Aug 17 2011
Posts: 15
I also need to add conditional scripting to the subtotal boxes I added outside the table.
In the table, I have the following columns:
Qty
Item
Day Rate
Weekly Rate
Montly Rate
# Days
Daily Total
#Weeks
Weekly Total
# Months
Monthly Total

Outside the table, I have subtotal boxes for daily, weekly and montly totals

Those subtotals should only show up if there are values in the # Days, # weeks, # Months cells

I set up similar, hidden, subtotal fields for those (#'s) columns and tried the following script in the visible subtotal columns:

if (daystotal == null) then
$.rawValue = 0
else
$.rawValue = sum (ToolOrderTable.Row[*].DayTotal[*])
endif

I got no error, but it didn't produce any result. The cell stayed blank no matter what info I entered in the table.

-tina

tgaspard
Registered: Aug 17 2011
Posts: 15
Just bumping this to see if anyone else has a suggestion for this:

I also need to add conditional scripting to the subtotal boxes I added outside the table.
In the table, I have the following columns:
Qty
Item
Day Rate
Weekly Rate
Montly Rate
# Days
Daily Total
#Weeks
Weekly Total
# Months
Monthly Total

Outside the table, I have subtotal boxes for daily, weekly and montly totals

Those subtotals should only show up if there are values in the # Days, # weeks, # Months cells

I set up similar, hidden, subtotal fields for those (#'s) columns and tried the following script in the visible subtotal columns:

if (daystotal == null) then
$.rawValue = 0
else
$.rawValue = sum (ToolOrderTable.Row[*].DayTotal[*])
endif

I got no error, but it didn't produce any result. The cell stayed blank no matter what info I entered in the table.

-tina

-tina