Page Total

I would like to add a page total to a report that I created. Accumulating a total is easy enough but I can’t find the right spot to reset the total for the new page. Does anyone know where to do this? I’ve tried to put this code in the Header, Transfooter, and Footer but none of them have worked correctly. IF CurrReport.PAGENO > 1 THEN IF LastPageNo <> CurrReport.PAGENO THEN PageTotal := 0; LastPageNo := CurrReport.PAGENO; Any suggestions? This seems like it should be an easy thing to do but the answer escapes me. I have a feeling that I’m missing the obvious. Thanks for your help.

Try this, 1 - Create a global var (for example: LastTotal Decimal) 2 - Create a TransHeader section with the following code LastTotal := 3 - Create a TransFooter section with a control to print the Page Total Expresión for the control: - LastTotal This will print the difference between the actual page and the previous one. Hope this helps.

That didn’t work for me either. I’m looking at the results now. If you take the first number off of page 2 and add it to page 1’s page total then it is correct. Maybe this will at least get me closer. I’m open to any other suggestions as well. Thanks.

Correction… The page total for page 1 included the amount of the first line of page 2. If I change the expression of the control to (TotalingVariable - LastTotal - Amount) the first page total is correct but on Page 2 the Page Total is missing the amount from the first line. I think I might still need different placement or a different approach.

Are you using CREATETOTALS for ? Are you writing the C/AL code on the TransHeader section or on the DataItem Trigger? I tested it on TransHeader section and it did work. TransHeader never includes the first record on that page: - On the first page = 0 - On the second page = First page transfooter and so on