End of report detection?

Hi again, My report is getting better and better, but I still have what I hope is a final question: How is the programming logic to detect when I’ve reached the final page of a report? I want the following: My report is an invoice, and on the final page I want to fill in a payment card with the total amount due. On previous pages, however, I want to blank the same field(s). Regards, Lars

Hi Lars! I don’t know, if there is a possibility to detect the end of a report, but maybe this could help you: Create a Footer-Section of your “main” DataItem (this will be placed at the end automatically), e.g. in Report 206 it’s Table No. 112, and put your Payment-Card there, and use the function CurrReport.NEWPAGE to make sure, it’s on it’s own page … Regards, Joerg Joerg A. Stryk Apollo-Optik, IT/ERP

Hi Joerg, >Create a Footer-Section of your “main” DataItem […] This is what I’ve done already. >[…] and use the function CurrReport.NEWPAGE to make sure, it’s on it’s own page … Unfortunately, this is not what I want; on the contrary, the payment card should stay on the last page off the invoice. Let me explain a little further: Most of our invoices are only a few lines and hence will fit on a single page. It’s customary in Denmark to have a payment card on the bottom of the page, and as long as the invoice is only one page, there’s no problems. I’ve created the code to include a payment-ID with a Modulus-10 control digit etc. However, when the invoice spans several pages, you’ll get several payment cards as well; again, this is common practice, however, only the last card should be valid - on the other cards, the amount fields should be blanked in some way like ‘******** **’. At the moment I’ve created a global variable, initialized it to the above “value”, and would then like to change the value to the invoice total on the last page. Regards, Lars

Hi, I found the solution myself; it’s amazing how many places you can stuff C/AL codes into ;-). For my report, I did the following: In the Invoicelines Header section I initialize my variable to ‘********** **’, and I then change it in the Invoicelines Footer section to the total amount due - using a rather cumbersome FORMAT() statement, BTW. Works fine now. Regards, Lars