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

Smartforms grand total problem

former_member211992
Active Participant
0 Likes
1,477

Dear all

I have calculated grand total in every page of smartforms but grand total values showing wrong in second page , my output has two pages,,here is an example

First page

                     credit       debit

                     1000          0

                     2000          2000

                      500          0

grand total      2500       2000

second page

                    credit       debit

                    1000        0

                     500         0

grand total    3000        2000

grand total of second page excluded the value in first row of second page.

i have calculated grand total using 'calculations' tab. how to rectify this

1 ACCEPTED SOLUTION
Read only

former_member211992
Active Participant
0 Likes
1,216

Dear all,

Thanks for all ur replies,

I have done the calculation in the  footer part by using loop and 'if' condition in sfsy-formpages.

8 REPLIES 8
Read only

venkateswaran_k
Active Contributor
0 Likes
1,216

Dear Karthik,

Use a Proram Code at end of last column of the table row.

Create a variable and cummulative it.

Print it at footer

OR

Let me know What is the Time and Reset  values used in the Calculation tab?

Regards,

Venkat

Read only

0 Likes
1,216

time - after loop

reset  is blank

i have tried program code as u said but grand total of first page includes  the value in first row of second page.

Read only

0 Likes
1,216

i had a similar problem.. so i deleted grand total from footer space of a table. Adjusted a new window. For this new window i wrote a code where i called the calculated variable (in your case, credit) as input parameter and assigned it to a new variable(output parameter). It worked after that. So can you loop and calculate "credit", in normal way. then adjust a new window. In this new window take input parameter as "credit". Then in Global definition of SF, declare "credit_sum" (any variable). Then in code of your new window, use "credit_Sum" as "Output Parameters" and in code section:

CLEAR credit_sum.

credit_sum = credit.

Regards,

KS

Read only

former_member182379
Contributor
0 Likes
1,216

Hi Karthick,

   As your requirement is to display the grand total amount in the first page only of the line items which are printed on the first page, and the items which are present on the second page only the additions of line item which are present in second page. If you have limted page only 1 or 2 pages then, first you need to check max. line item which can get printed on the first page then in the internal table add the amounts of only those items same for second page, but this will not work if you have more number of pages.

Regards,

Zafar

Read only

0 Likes
1,216

time is after loop

Read only

0 Likes
1,216

Try with time  Before loop.

Read only

Former Member
0 Likes
1,216

Hi Karhik,

According to your logic you are displaying grand total per each page, when it comes to first page it correct. In second page it is adding total of first and second page.

so try

sum = sum + debit.

grand = grand + sum.

Also check control break statements.

Thanks & Regards,

Goutam Kolluru.

Read only

former_member211992
Active Participant
0 Likes
1,217

Dear all,

Thanks for all ur replies,

I have done the calculation in the  footer part by using loop and 'if' condition in sfsy-formpages.