Re: page 1 of x in 4gl reports ???
Posted in 1996
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
If you have a consistant number of rows per page it would probably be
easier to do something like :
GLOBALS
DEFINE g_total_pages SMALLINT
...
...
{ Just before report cursor loop }
SELECT count(*) INTO number_of_rows FROM <same sql as rest of reportcursor>
LET g_total_pages = number_of_rows / <number of rows per page>
LET g_total_pages = g_total_pages +1
The global variable will then be available for use anyway you want in the
report.
Neil Hopkins.
> Andrew Cilia <acilia@mail.link.net.mt> wrote in article
<322E6EF2.11A3@mail.link.net.mt>...
> Advanced Server for UNIX user wrote:
> >
> > We are constantly being asked to provide reports with PAge 1 of X
on... removed ...
>
> What you could try is by inserting a unique set of characters such
> in the position of the report where total number of pages is supposed to
be:
> example :
> print pageno, " Of ", "xxxgarbagexxx"
>
> then print the entire output to a pipe. This pipe should firstly
> cat the input into a temporary file such as "cat > /tmp/tmp$PID. Then
> run some script to count the number of page throws that you have,
subtract
> one, use that number to sed the orginal file to substitute the unique
> set of characters and output the result to the printer. I haven't tried
> this myself but with a bit of tweeking, it should work.
>
> Andrew Cilia
> Philip Toledo Limited - Malta
>