Re: reporting into different files with one report
Posted in 1995
} Subject: Re: reporting into different files with one report } Date: Wed, 25 Jan 1995 20:35:38 +0100 } To: alan@po.den.mmc.com (Alan Popiel) } From: Joerg_Spilker@daolin.fido.de (Joerg Spilker) } Organization: Fido.DE domain gateway (IN e.V.) } } >> I tried with the REPORT TO variable statement in the report itself and } >> "variable" was a report parameter with the filename to report to. But all } >> data goes into the file passed first to the report. Later changes in the } >> parameter have no effect. } >> } >> Greetings, Joerg } > } > Guten Morgen, Joerg. } > } > I will assume you START REPORT rpt_name TO "report.file1". Then after } > you FINISH REPORT rpt_name, you can do the following: } > RUN "cp report.file1 report.file2" } > RUN "cp report.file1 report.file3" } > This is not quite simultaneous, but the two copies of the report file } > become available just after the original report file is available. } } Guten Abend Alan :-) } } No, what i want is something completely different. The reports should not } contain data. Only the structure of the reports is the same. } } START REPORT rpt TO file1 } START REPORT rpt_copy to file2 } } FOR SOME COMPANIES } FOR ALL ROWS OF COMPANY DATA } DO DIFFICULT COMPUTATIONS } } INSERT ROWS INTO RESULT TABLES } } IF RESULT < 0 } OUTPUT TO REPORT rpt } ELSE } OUTPUT TO REPORT rpt_copy } END IF } END FOR } END FOR } } The problem is that i can't order the data according to result. In this case, i } would just close rpt and open again with new filename if RESULT changes from <0 } to >= 0. } } The only way for sorting was to put all computed data into temp tables and then } select them again ordered by RESULT. But this was much more complicated as just } copying the code of rpt to rpt_copy. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } } Greetings, Joerg I think you have already found the best solution, Joerg. Because 4GL uses static variables to maintain line counts, page break status, usw., in reports, it is not possible to pass a "file variable" to a single report and have it write first to this file, then to that file. Therefore having two or three duplicate-except-for-name reports is the way to do what you wish. It's not elegant, but it works. Obviously I and the dozen or so folks who offered variations on using "tee" did not understand at first quite what it was that you were trying to do. Regards, Alan -- R. Alan Popiel Internet: alan@den.mmc.com Martin Marietta, SLS Voice: 303-977-9998