Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Page Total Problem
Message
 
 
À
02/06/2008 11:09:54
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01320884
Message ID:
01321006
Vues:
43
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform