ā2013 Oct 23 10:02 AM
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
ā2013 Oct 25 11:18 AM
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.
ā2013 Oct 23 10:06 AM
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
ā2013 Oct 23 10:37 AM
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.
ā2013 Oct 23 11:07 AM
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
ā2013 Oct 23 10:16 AM
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
ā2013 Oct 23 11:06 AM
ā2013 Oct 23 1:12 PM
ā2013 Oct 23 11:21 AM
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.
ā2013 Oct 25 11:18 AM
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.