Re: Sometimes I just wonder, "WHY?!"
Posted in 1994
walt@mathcs.emory.edu (Walt Hultgren {rmy}) writes: >I have also used that method to initialize variables in reports. However, >along came I4GL 4.10. Thus sayeth $INFORMIXDIR/release/TOOLREL_4.1: > Advisory: PAGE HEADER PROCESSING IN REPORTS > ------------------------------------------- > Associated Bug: 3680 > PAGE HEADER PRINTS PREVIOUS ROW'S VALUE WHEN PREVIOUS PAGE FILLED > All 4.10 and older product report processing (I4GL, RDS, ACE) will > defer execution of the PAGE HEADER block until the first SKIP, PRINT, > or NEED statement on the ON EVERY ROW block unless a new page > is triggered by SKIP TO TOP OF PAGE or NEED. This assures that > the new row's values are available for printing in the > PAGE HEADER block, after a group value changes. > Note that this can affect reports that are coded to set user- > defined program variables in PAGE HEADER and then use those > variables to control behavior in ON EVERY ROW before any PRINT, > SKIP or NEED. Therefore, a report should not specify behavior > in the the ON EVERY ROW section that depends on values set > in the PAGE HEADER section. >Note the absence of a suggested work-around. :-( I still use the same >method to initialize variables, but now I have to remember about PAGE HEADER >behavior. >An alternative might be to use global variables for running totals, etc., and >initialize them outside of the REPORT module. Can anyone comment >definitively on that idea? I experiences the referred-to bug on occasion years ago, mostly if I was not completely through in making sure that all lines of an AFTER GROUP OF control block printed before a page break (not setting NEED, etc.). I'd be willing to wager the bug does not manifest itself on the first page of the report, since there are no "previous" control blocks to contend with, etc.; thus the IF PAGENO = 1 ... scenario is still valid. It's only speculation; though; I haven't tested. Your other point is perfectly valid, though, Walt. Certainly using modular or global variables is a way to achieve the same results. There is a memory hit, of course, but it's not severe for relatively few (1-100) variables. ======================================================================= Dennis J. Pimple dennisp@informix.com Opinions expressed Senior Consultant -------------------- are mine, and do not Informix Software Inc Voice: 303-850-0210 necessarily reflect Denver Colorado USA Fax: 303-779-4025 those of my employer. Which reminds me of my participation in the company "New Hire" class 4 years ago. I was already a 5+ year vetern of 4GL, but I was sitting in on the 2-day 4GL overview section of the class. Instructor: "You must pass at least 1 parameter to a 4GL report" Me: "No you don't" I: "Yes you do." M: "No you don't" I: "Yes you do." M: "How many reports do you want me to write without passing any parameters?" I:"Dennis, which don't you spend the rest of today and tomorrow on the technical support desk?"