Hi!
I have created an expanding table using subforms that adds a row or deletes a row with the click of a button. I also need the rows to total, my problem is that the rows that are added are not being calculated. I have the minimum set to three, and it picks up those, but when I add a row it doesn't add the value in it. Any suggestions would be greatly appreciated....
Solved! Go to Solution.
Views
Replies
Total Likes
The FormCalc sum functions can be used to total columns in all rows, where all rows have the same name. If you name each row uniquely you cannot take advantage of this function.
// form1.page1.subform1.table.row[1].totalWins::calculate - (FormCalc, client)
$.rawValue = sum(form1.page1.subform1.table.row[*].wins)
See the attached.
Steve
Views
Replies
Total Likes
The FormCalc sum functions can be used to total columns in all rows, where all rows have the same name. If you name each row uniquely you cannot take advantage of this function.
// form1.page1.subform1.table.row[1].totalWins::calculate - (FormCalc, client)
$.rawValue = sum(form1.page1.subform1.table.row[*].wins)
See the attached.
Steve
Views
Replies
Total Likes
Attached sample can help you.. It also has minimum 3 rows at the initialization and then you can add rows at run time.
Thanks
Srini
Views
Replies
Total Likes
Steve,
A non-repeating(static) table automatically names its rows, Row1, Row2,... RowN. Is there a clean way to sum them?
I have Row1 + Row2 +.. RowN for 21 rows.
It works, but is very tedious (and unsightly). Is there a cleaner way to sum them?
Views
Replies
Total Likes
The below code can help you get access to each row inside a static Table. You can put your processing statements inside the If condition where I placed the messageBox statement.
for (i=0;i<Table1.nodes.length;i++){
if(Table1.nodes.item(i).name.substr(0,3)=="Row")
xfa.host.messageBox(Table1.nodes.itemi).name);
}
Thanks
Srini
Views
Replies
Total Likes
Srini,
Very nice. Very nice. Your answer has taught me some new properties of the table object, as well as the substr (method?) (function?). Thank you.
Views
Replies
Total Likes
To make use of FormCalc wildcards I go in and rename the rows to have the same so that they gain instance numbers.
Views
Replies
Total Likes
Smart.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies