Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Page Total Problem
Message
 
 
To
02/06/2008 11:09:54
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01320884
Message ID:
01321006
Views:
42
>Hi,
>Thank for your reply, can you suggest any
>solution for this case ?
>
>Derek

Two possible solutions. If your data always look the same (no stretch with overflow, for example), then you may find out how many records fit on a page and pre-calculate number of pages.

The other way would be to do it when report is run, but this would require two passes, as I said.

In the Group footer insert a field with something like UpdatePageTotal()

the UpdatePageTotal function would be something like

if m.lFirstRun
insert into curPages values (GroupID, _pageNo)
endif

Create a cursor curPages in advance with GroupID and TotalPages fields.

the first time you run your report set lFirstRun variable to .f.

in the Page expression you would put something like

'Page ' + transform(_pageno)+ iif(vartype(m.lFirstRun) = 'L' and not m.lFirstRun, ' of '+ transform(iif(seek(GroupID,'curPages','GroupID'),curPages.TotalPages,_pageno)),'')
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform