Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VFP reports with "_pageno of Total pages"

1,538 views
Skip to first unread message

Sistemas Informáticos S.R.L.

unread,
Feb 4, 1999, 3:00:00 AM2/4/99
to
Help!!!
Does anybody can help me.
I need to inform in a report the current page and total pages in it.
for example 1 of 7, 2 of 7, etc.
Do a have a system variable ?
I can't use numbers of line because are variable per page.
Any other idea ?
Thanks in advance.
Rodrigo.


Trevor Feldman

unread,
Feb 4, 1999, 3:00:00 AM2/4/99
to
The only thing you can do is print the report twice. The first time, print
to a file, saving the _pageno variable to a public variable through a UDF
placed in the report somewhere. Then print the report again for real, this
time using the variable you saved from the first run to indicate the total
number of pages (deleting the file you created from the first run).

This is not the most elegant solution, but it works. In FoxPro, it is
really the only way to do it, since the Report Generator does not know how
many pages there are until it is finished .....

-- Trevor Feldman


Sistemas Informáticos S.R.L. wrote in message
<79d29s$d3q$1...@ul3.satlink.com>...

Rick Bean

unread,
Feb 4, 1999, 3:00:00 AM2/4/99
to
An alternative is at <http://www.eps-software.com>. Go to the free download
area, and select Visual GenRepoX 3.0. The total pages is just one of the
many pieces of 'magic' this package offers.

Rick

Trevor Feldman wrote in message <79d7r0$1...@sjx-ixn5.ix.netcom.com>...

Anders Altberg

unread,
Feb 5, 1999, 3:00:00 AM2/5/99
to
The system variable _PAGENO is always reset to 0 when a report starts but
remains after the report.
So you can run the report once to a window activated off screen to get a
value for _PAGENO, move _PAGENO to a public variable you can refer to in the
report as total pages.
nTotalPages = 0
DEFINE WINDOW x FROM ...
ACTIVATE WINDOW x
REPORT FORM x
RELEASE WINDOW x
nTotalPages = _PAGENO
REPORT FORM x TO PRINTER
-Anders

夜来香

unread,
Feb 5, 1999, 3:00:00 AM2/5/99
to
Anders,

When First Run Report, U can:

REPORT FORM x TO FILE null: NOCONSOLE
~~~~~~~~~~~~~~~~~~~~~~~
All Sample:

lnMaxPages = 0
REPORT FORMAT Format TO FILE null: NOCONSOLE
lnMaxPages = _PAGENO
REPORT FORMAT Format TO PRINTER NOCONSOLE

--Tuberose, From Shanghai / China (P.R.C)

Tuberose Hotel Web :
http://www.fortunecity.com/skyscraper/solomon/517/ OR
http://foxers.126.com
This is a Foxer Club From China by GB Code.
This is also a site where discuss Visual FoxPro, FoxPro for Windows,
FoxBASE+, and so on...


Anders Altberg wrote in message <8mru2.4051$d4....@nntpserver.swip.net>...

Anders Altberg

unread,
Feb 5, 1999, 3:00:00 AM2/5/99
to
Hi
I wonder if TO FILE null: works in NT. There are also circumstances where
the page count may be inaccurate when you run the report to another
destination than the printer. I think sending the report to a window is a
safe way.

夜来香 wrote in message ...

0 new messages