Re: Writing reports
Posted in 1998
Topics: General Discussion
I'm sure there are examples of this in the archive. The basic solution is to quit thinking of the OUTPUT TO REPORT as having to happen once and only once per fetched row. In your case, you want to fetch two rows before doing output. For instance, something like: LET siCount = 0 FOREACH cursor INTO record.* LET siCount = siCount + 1 LET array[siCount].* = record.* IF siCount = 2 THEN OUTPUT TO REPORT rptFunction( array[1].*, array[2].*) LET siCount = 0 END IF END FOREACH IF siCount = 1 THEN # output the last unmatched row INITIALIZE array[2].* TO NULL OUTPUT TO REPORT rptFunction( array[1].*, array[2].*) END IF This approach also complies with dennisp's unwritten rule of reports: the REPORT function should be primarially for formatting only, keep as much processing logic as possible in the report driver function. In article <71p1sm$3u9$1@news02.btx.dtag.de>, NDSTURNERBUND@t-online.de (Dirk Emmermacher) wrote: > Hi, > I've got a new job on my database. I try to make a report that do > following: > Adress-etiketten with to rows (That's no problem) > and various counts of one record (From one to n etiketten ) > I'm using INFORMIX 4.00. > Has somebody a solution for this problem?? > > Here is an example for the output: > > Mr. Mr. > Steve Miller Harry Smith > Broadway 3 Hollywoodroad 100 > 12345 New York 23456 Los Angeles > > Mr. Ms. > Harry Smith Barbara Miller > Hollywoodroad 100 Plaza 3 > 23456 Los Angeles 77777 Chicago > > Thanks!! > -- Dennis J Pimple Informix Software, Inc. Denver, CO, USA -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own