simple but long 4gl question
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
i am using informix 4gl version 7.20.UD4, on an hp-udx 10.20, with ods vers
7.30uc5. my problem is that my page header includes a grouped by field, and
it only changes the value of that field on the following page!
Possible values for field1 would be ABC,DEF,XYZ for eg.
The crux of the report is as follows:
**
select field1,field2,... field30
from tablename
order by field1,field2,field3...
output
...
order by rep_rec.field1, rep_rec.field3...
page header
print column 1,"Report for : " rep_rec.field1
skip 1 line
...
on every row
print column 2, rep_rec.field1,.......
after group of rep_rec.field1
print column 2, "TOTAL FOR ",rep_rec.field1,
column 20, group sum(rep_rec.field3) ......
skip to top of page
**
The output i received was:
Report for : ABC
ABC ...
TOTAL FOR ABC 12345
^L
Report for: ABC { this is where the DEF should appear, but it only appears
on the following page header!!)
DEF ...
any help would be appreciated.
-hk
Try putting the 'skip to top of page' into a BEFORE GROUP OF clause, instead of AFTER GROUP OF. - Paul
Try moving the "skip to top of page" to a BEFORE GROUP OF rep_rec.field1
clause. The value has not changed yet in the AFTER GROUP of clause
which is forcing the page skip and the generation of the new page
header. By the time the BEFORE GROUP OF has been executed this will
be OK. If you get an extraneous skip at the beginning of the report
just set a global or passed in variable to indicate the first page
condition and test it before issuing the "skip to top...".
Art S. Kagel
hkchan wrote:
>
> i am using informix 4gl version 7.20.UD4, on an hp-udx 10.20, with ods vers
> 7.30uc5. my problem is that my page header includes a grouped by field, and
> it only changes the value of that field on the following page!
> Possible values for field1 would be ABC,DEF,XYZ for eg.
> The crux of the report is as follows:
> **
> select field1,field2,... field30
> from tablename
> order by field1,field2,field3> ...
> output
> ...
> order by rep_rec.field1, rep_rec.field3...
>
> page header
> print column 1,"Report for : " rep_rec.field1
> skip 1 line
> ...
> on every row
> print column 2, rep_rec.field1,.......
>
> after group of rep_rec.field1
> print column 2, "TOTAL FOR ",rep_rec.field1,
> column 20, group sum(rep_rec.field3) ......
> skip to top of page
> **
> The output i received was:
> Report for : ABC
> ABC ...
> TOTAL FOR ABC 12345
> ^L
> Report for: ABC { this is where the DEF should appear, but it only appears
> on the following page header!!)
> DEF ...
>
> any help would be appreciated.
> -hk