Joerg's Problem
Posted in 1995
>From Joerg_Spilker@daolin.fido.de Fri Jan 27 06:40:39 1995
>Date: Wed, 25 Jan 1995 20:27:28 +0100
>Subject: Re: reporting into different files with one report
Here is my solution to Joerg's problem (if I understand the scenario
correctly):
>I try to explain the problem with some code.
>START REPORT BLA TO file_2
>START REPORT BLA_COPY TO file_2
Use a single report with a record that will allow for the information
for both results.
>FOR LOTS OF COMPANIES
> FOR LOTS OF ROWS
> MAKE DIFFICULT COMPUTATIONS
> INSERT INTO MANY TABLES
> IF RESULT < 0
call format_data(variables) returning report_rec.*
Send to a function that will format your data into the report record,
then return this record.
> OUTPUT TO REPORT BLA
Not yet...
> ELSE
call format_data2(variables) returning report_rec.*
Send to a function that will format your data into the report record,
then return this record.
> OUTPUT TO REPORT BLA_COPY
end if
output to report (report_rec.*)
> END FOR
>END FOR
If the results create different fields for printing, the report will
need to check for flags or fields with length(field) = 0, or something
like that, to control printing or formatting. Theoretically, you could
use this approach to format for any number of possible results ie instead
of an IF THEN... ELSE, you could use a CASE statement. Fourgen's latest
report code sends a single line to the report. The line is formatted
by a function(s) just before OUTPUT TO.
Hope this helps...
----------- There are more things in heaven and earth, Horatio, ----------------
Scott Holmes <sholmes@netcom.com> Informix 4GL Applications
---------------- Than are dreamt of in your philosophy. ------------------------