Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

samrtforms wrong calculations within table loop

Former Member
0 Likes
1,099

Hi experts!!

I have the following problem.

I loop through an internal table in my smartform. On the table footer i display the CarryForward value (subtotals of the items printed on each page). Before writing each item i add its value to a variable and before end of main window on the footer i display this variable.

The problem is that subtotals are wrong. Calculations take into account next page's first item.

Any idea????

Please help!!!!

Edited by: Vijay Babu Dudla on Jan 16, 2009 4:24 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
928

hey how u r summing the total, do it like this.

if u r using a table node then goto calculations tab .

selct the operation as totals, then give src and target field, it will autmatically calulate the sum into target field but if still the problem persists then changing main window will definately help.

6 REPLIES 6
Read only

Former Member
0 Likes
928

Have u put page protection at line item level, it shud be thr.

Also to solve ur problem what u need is to adjust the main window,

just slipghtly reduce it, may be by 2-3 mm and now execute and see by little adjustment ur problem will be solved.

кu03B1ятu03B9к

Read only

amit_khare
Active Contributor
0 Likes
928

Did you try doing calculations after writing the line...?

Please don't use ALL upper case in title of the post.

Read only

Former Member
0 Likes
929

hey how u r summing the total, do it like this.

if u r using a table node then goto calculations tab .

selct the operation as totals, then give src and target field, it will autmatically calulate the sum into target field but if still the problem persists then changing main window will definately help.

Read only

Former Member
0 Likes
928

Hi all & thank u!

I tried adjusting the main window but it did not work..

How can put page protection at item level & will it help???

Thank u once again!

Read only

Former Member
0 Likes
928

I still haven't been able to find a solution.

What i have noticed during tests is that the calculations are correct if the remaining space of the main window is reduced. What i mean by remaining space?? in my main window before the line items i display a line with some header data. If the data take 3 lines of space then the calculations are correct, otherwise the calculations take into account next page's first line item, even though it is not displayed on the page..

Please help!!!!

Read only

0 Likes
928

actually this problem occurs because the calculation is done in smartforms before it prints so before it may estimate that 4 line items are fitting into one page so it calculates total accordingly, now if at time of printing the 4th line item doesnot fit completely and u hv applied page protection so at that time it is moved to next oage but since total is already calculated so u get sum of 4 line items even if u see 3 on one page.