|
Viji, Do not rely on the PAGE for the current Page#. Determine the number of report details per page ahead of time (theoretical), READE thru the file and set up page count accumulator. every time you reach your theoretical detail count/page add 1 to accum. At end of file if you did not reach theoretical page, you will add 1 again. However, you will not be able to use the Primary file process this way(old RPG cycle which I find handy when dumping a quick report) OR Do OPNQRYF and count the records thru, I believe, %count, in a group select and divide the Result of %count by the number of theoretical detail lines per page.(hard coded) Pass the result as a parm to RPG. OR Query mgmt query (sql) in CLP to produce a file with one field being record count. Select count(*) from lib/file where flda = 'A' and fldb = 'B' strqmqy (qmqry) *outfile(qtemp/file) Read file in report RPG as external data structure. Then you'll have total records and then divide total rcds by theorectical detail lines per page. The syntax I gave is off, do not have clean online example here. Let me know of any more efficient ways. Jeff >From: "jegdish ilango" <jegdishlan@hotmail.com> >Reply-To: RPG400-L@midrange.com >To: RPG400-L@midrange.com >Subject: Print Total Pages in Report >Date: Fri, 09 Feb 2001 05:04:37 >MIME-Version: 1.0 >X-Originating-IP: [203.163.64.81] >Received: from [192.160.127.90] by hotmail.com (3.2) with ESMTP id >MHotMailBC4CCA78002CD820F3DDC0A07F5A071B0; Thu Feb 08 21:26:20 2001 >Received: (from uucp@localhost)by uucphost.mcs.net (8.11.1/8.11.1) with >UUCP id f195QF216469;Thu, 8 Feb 2001 23:26:15 -0600 (CST)(envelope-from >rpg400-l-owner@midrange.com) >Received: from localhost (mail@localhost)by linux.midrange.com >(8.9.3/8.8.7) with SMTP id AAA16224;Fri, 9 Feb 2001 00:10:12 -0600 >Received: by linux.midrange.com (bulk_mailer v1.13); Fri, 9 Feb 2001 >00:10:09 -0600 >Received: (from majordom@localhost)by linux.midrange.com (8.9.3/8.8.7) id >AAA16154for rpg400-l-outgoing; Fri, 9 Feb 2001 00:10:07 -0600 >Received: (from uucp@localhost)by linux.midrange.com (8.9.3/8.8.7) with >UUCP id AAA16147for RPG400-L@midrange.com; Fri, 9 Feb 2001 00:10:06 -0600 >Received: from hotmail.com (f32.pav1.hotmail.com [64.4.31.32])by >uucphost.mcs.net (8.11.1/8.11.1) with ESMTP id f1954i612407for ><RPG400-L@midrange.com>; Thu, 8 Feb 2001 23:04:44 -0600 (CST)(envelope-from >jegdishlan@hotmail.com) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; >Thu, 8 Feb 2001 21:04:37 -0800 >Received: from 203.163.64.81 by pv1fd.pav1.hotmail.msn.com with HTTP; Fri, >09 Feb 2001 05:04:37 GMT >From rpg400-l-owner@midrange.com Thu Feb 08 21:28:07 2001 >Message-ID: <F32BylrQa7kaHvHJ1i90000cdcc@hotmail.com> >X-OriginalArrivalTime: 09 Feb 2001 05:04:37.0913 (UTC) >FILETIME=[CD363090:01C09255] >Sender: owner-rpg400-l@midrange.com >X-List-Name: RPG/400 Discussion Mailing List (RPG400-L@midrange.com) >X-MIME-Autoconverted: from 8bit to quoted-printable by uucphost.mcs.net id >f195QF216469 > > >Hello all, >We have an RPG program to print a detailed report . >The page number in the report is done automatically using the >reserve word PAGE in the 'O' spec. >Now, our user wants to indicate the total Number of pages after the >page number on each page, ie, 'to show " Page 1 of 3 Pages" etc., >instead of "Page 1, Page 2......". > >Can anyone advice us of how to go about this in RPG program? > >Thanks in advance, >Viji >_________________________________________________________________________ >Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. > >+--- >| This is the RPG/400 Mailing List! >| To submit a new message, send your mail to RPG400-L@midrange.com. >| To subscribe to this list send email to RPG400-L-SUB@midrange.com. >| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. >| Questions should be directed to the list owner/operator: >david@midrange.com >+--- _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.