Good Day Everyone!
Question about reports as it’s been a long time since I’ve worked with them.
How can I have a DETAIL band function as a footer? For example, PRINT the DETAIL band after all the records have been processed?
I seem to remember setting the report filter for the DETAIL band to FALSE but I don’t remember how to trigger the PRINT after the records are processed.
you’d want to PRINT() the detail before the ENDPAGE()
This is unlikely possible in general case. On the one hand, the report stuff in the RTL can cache PRINTed details up to 2 pages if there are no widow/orphan settings and up to 3 pages if details have such settings depending from actual heights and contents of printed details. On the other hand, the only detail can be split and its parts can be printed on several pages if this detail contains TEXT, RTF or LIST controls. Only after making a decision where to break pages the report stuff in the RTL prints the footer for complete pages. It’s late to add something at this time because the “current page” for next PRINTs is other.
Possible solution is post-processing of files with report pages.
Another solution is to use the ABSOLUTE attribute for details to print and control their places on the page yourself. Use ENDPAGE to signal the RTL that the page is ready to be printed/written to file.
I’ve got it working with:
ThisReport.Next PROCEDURE(BYTE ProcessRecords)
ReturnValue = PARENT.Next(ProcessRecords)
If ReturnValue = Level:Notify
Basically whatever works, works, but I generally use the .AskPreview method since it’s processed at the very end of the report, just do it before the parent call since it does an ENDPAGE().
If you wanted you learn another way you could declare your DETAIL inside a BREAK( EndRpt# ) group which can have its own FOOTER. So it’s all declared in the Report, there is no code to write.
You would never change the Break Variable to cause a break, there would be an automatic break at the end of the report that would print the Footer once. I would think it would work to use FALSE as the variable.
I’m sorry. In my posts here I missed that the detail should be printed once only after all records printed.