Re: page 1 of x in 4gl reports ???
Posted in 1996
Except for the fact you not putting into account the PAGE HEADER, PAGE TRAILER, AFTER GROUP, BEFORE GROUP stuff. Not goin' do it... (As George Bush might have said) :-) Neil Hopkins writes: * * 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 report * cursor> * * 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 * > Thanks, ----------------------------------------------------------------------------- Robert Minter Data Systems Support Senior Software Engineer A Client Technologies Company E-Mail: rob@dssmktg.com Tel: 714.771.0454 Fax: 714.771.3028 #include <std_disclaimer.h> http://www.dssny.com