Re: Forcing a complete report page with "No data found" message
Posted in 1993
Fellow netters, I have had some success with the following technique for forcing a complete report page with the "No data found" message. It requires the use of a global variable and one forced call to the report, but that is less dangerous than GO TO (St. Djikstra frowns) or RETURN (Andrew Burt discusses bug #20562). DEFINE total_lines SMALLINT { global def. } ... START REPORT rpt LET total_lines = -1 { must precede the first OUTPUT } OUTPUT TO REPORT rpt ( params ) { one forced call, after START and LET } ... OUTPUT TO REPORT rpt ( params ) { in some loop, no doubt } ... FINISH REPORT rpt ... REPORT rpt ( params ) { note: total_lines is NOT a parameter } ... FORMAT FIRST PAGE HEADER PRINT "Page Header" { blank line will be printed by first IF in ON EVERY ROW } PAGE HEADER PRINT "Page Header" SKIP 1 LINE ON EVERY ROW IF ( total_lines < 0 ) THEN SKIP 1 LINE { from forced call } ELSE ... { rest of normal printout } END IF LET total_lines = total_lines + 1 ON LAST ROW IF ( total_lines <= 0 ) THEN PRINT "No data found" ELSE { optional } SKIP 1 LINE { optional } PRINT total_lines, " data items found" { optional } END IF PAGE TRAILER SKIP 1 LINE PRINT "Page Trailer" END REPORT Regards, Alan ___________________________ ______________________| R. Alan Popiel |__________________________ \\ Internet: | Martin Marietta, Tech Ops | / \\ alan@den.mmc.com | P.O. Box 179, M/S 5422 | Std disclaimers apply. / )Voice: | Denver, CO 80201-0179 USA | ( / 303-977-9998 |___________________________| (But you knew that!) \\ /________________________) (____________________________\\