The Accidental Report, or, Last page detection

Quite by accident, I have found a report design that (correctly!) prints a “Last Page” label at the end of the report. There have been threads about counting the number of pages. I haven’t stumbled across a solution to that one … yet [:-)] but I wanted at least to indicate that the last page had been reached. I thought I’d let you know about the solution I came across, because there have also been some threads about last page detection, and about spurious blank pages (minor changes to the report can lead to blank pages, or having the page number print only on the last page). The report has the following data items: Sales Inv. Header Sales Inv. Line Integer [DataItemTableView: WHERE(Number=CONST(1)) ] Sales Inv. Header must have NewPagePerRecord = No (this sucks, but I get spurious pages at the end otherwise). Sales Inv. Header has two Footer sections. Both have PrintOnEveryPage = Yes, PlaceInBottom = Yes, and the first one must have KeepWithNext = Yes. The first Footer section prints the page number, as usual. The second section has exactly one blank line, and CurrReport.SHOWOUTPUT(FALSE) (incidentally, Showoutput seems to work even in OnPostSection, despite what the Programming manual says). There is one Integer Footer section, with a “Last Page” label. The result is that I get Page 1, Page 2, etc. at the bottom of page 1, page 2, etc., while the bottom of the last page shows: Page 5 Last Page There are some things that I don’t understand, e.g. why Sales Inv. Header must have NewPagePerRecord = No; what the SHOWOUTPUT is doing (if the second Footer section has n blank lines, then n-1 blank lines get printed; so when n=1, it doesn’t produce any output, but influences the other sections; if n=0, then the section doesn’t have any effect at all). Well, I didn’t say that the settings make sense, just that they work.