06-14-2013 7:21 AM
hi good day,
i have a subtotal where i sum up all the values of the 1st page and display as the subtotal
on second page i sum up all the values of the 2nd page and display as the subtotal
on third page i sum up all the values of the 3rd page and display as the subtotal etc...
now the requirement is,
1. user wants the total of the first page and display as the sub total.
2. when 2nd page he wants the total of the 1st page + 2nd page = subtotal (in 2nd page subtotal)
3. on 3rd page total of the 1st page + 2nd page + 3rd = subtotal (in 3rd page subtotal)
ex : 1st page = values (1 +1 + 1 = 3 as subtotal )
2nd page = values (2 + 2 + 2 = (3 + 6 = 9 as the subtotal))
3rd page = values (1 + 1 + 1 = (3 + 6 + 3 = 12 as the subtotal))
how would i get it to this point please?
06-14-2013 9:39 AM
Are you using smartform or just a simple list?
In any case, please declare a variable say tot. just before subtotal is printed use:
tot = sub_tot + tot.
then use this variable "total" for subtotal printing. On first page,it's value would be equal to value of sub total on first page and on subsequent pages it would have the values of previous pages plus the sub total of current page.
Please paste section of your code where sub total is printed, in case this does not help.
Regards
06-14-2013 9:52 AM
Hi,
Declare Total as global variable and subtotal as local.
total = total + subtotal.
clear subtotal.
Thanks
.
06-14-2013 10:04 AM
Hi Jacob,
You are completed almost everything just do the following,
lv_total = subtotal + lv_total.
Very first time tot haven't any value so it will print sub total in the first page after the consequence pages it will add the previous total into it.
Warm Regards,
John.
06-14-2013 10:06 AM