Re: page 1 of x in 4gl reports ???
Posted in 1996
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
I normally do not commit stuff from this group but . . . On 5 Sep 96 at 8:47, Robert Minter wrote: } 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) :-) Depanding on running time and CPU/System load I would try - setting a print flag, (no printing or just run it twice) run the report, get the last page number and run it again (unless big data changes) or - the nice (very nice) thing about 4gl reports is access to the page number and being able to update the database from the report (I have made large 1500+ page reports and produce index reports on the large report). I also have used the 'cat' or 'sed' filter stuff (mostly for formating (tabs, columns, page breaks, etc). Hope this helps. } } 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 Regards, Greg (gdc) __________________________________________________________________ Gregory D. Chandler aka N2MQO Email: gchand@rome.iitri.com Reliability Analysis Center (RAC) 201 Mill Street WWW: http://rome.iitri.com/rac/ Rome, NY 13440 USA Voice: 315-339-7046 FAX: 315-339-9932 _____________________** a DoD Information Analysis Center (IAC) **_