Re: Multiple "instances" of a report, all going at once?
Posted in 1994
In article <30h1s6$8uk@infmx.informix.com> proberts@informix.com (Paul Roberts) writes: >OK, is there a way to do this? (I am pretty sure the answer is "no"). > >I want my program to write out a number of different output files, >all at once, all in the identical format. So I'd like to start >several "instances" of a single report, output rows to each of them, >then finish each report, then stop. Several ways to do this come to mind. I assume, BTW, that you're talking about 4GL. One way would be to have an outer cursor/foreach loop that selects the data ordered by state. Every time the state changes, FINISH and reSTART the report for that state. This will restart the page numbering at (1). You could then burst the report pages or run the output file through awk as needed. Or, generate the output file name on the fly, and START the report to a different file for each state. If you can't order the data directly from the database in the appropriate order, generate the results to a temp table, then select back from the temp table for the report, ordered by state. Another way relies on the fact that you *can* have multiple reports being generated concurrently. We have report programs that START a grand totals report, then repeatedly START and FINISH sets of group summary and detail reports. At the end, the grand total report is FINISHED. We do this to satisfy some unusual report collating requirements. This approach might work for you. I've never tried to have multiple copies of the same report going at the same time. If a REPORT is really a function with just one control structure, you're probably out of luck, If that does work, I would certainly give it a full test before delivering to the customer to make sure to don't hit any limits on open files. Good luck, Walt. -- Walt Hultgren Internet: walt@rmy.emory.edu (IP 128.140.8.1) Emory University UUCP: {...,gatech,rutgers,uunet}!emory!rmy!walt 954 Gatewood Road, NE BITNET: walt@EMORY Atlanta, GA 30329 USA Voice: +1 404 727 0648