Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to print ## of ## in report ?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00037403
Message ID:
00037567
Vues:
40
>>>I want to print ## of ## in VFP report.I run the report twice as following...
>>>- First,I ran REPORT FORM NOCOSOLE to get total number of page printed in _PAGENO variable.
>>>- Second,I used _PAGENO to build an expression on VFP reporting to produce my desired string.
>>>
>>>Unfortunately,_PAGENO may not always carry correct result if some fields was strentched in report.Anybody have an idea about this problem or any alternatives ? Please kindly advise.
>>>
>>>Thanks in advance.
>>>Arnold
>>>23 June 1997
>>>knaarnd@netvigator.com
>>
>>Arnold,
>>
>>The FoxPro report writer is a one pass reporting tool, and unfortunately, there's no sure fire way (as you've found) to accurately determine how many pages a report will contain. This also causes the page layout to not always be exactly the way that you'd like. The upside is that report generation is generally faster than with a two pass reporting tool.
>>
>>You might want to look at some third party report generators, such as Crystal Reports or FoxFire!, to see if you can find one that will have this feature.
>>
>>George
>
>crystal reports does. foxfire (as far as i can tell) doesn't.

I remembered a "tip" in FPA (May 1995 issue, pg 19). The workaround was:

He set up a user defined function first.

Function SetPage
nNumPages = _PageNo
return ""

In the report, he added an expression object that contained a call to SetPage() which is ultimately called everytime the page changed. But the last call would be the value you are looking for. To get this to work in Windows, the code given is:

nNumPages = 0
cTmpFile = Sys(3) + ".TMP"
REPORT FORM filename NOCONSOLE TO FILE (cTmpFile)
ERASE (cTmpFile)
REPORT FORM filename NOCONSOLE TO PRINTER [or PREVIEW]

However, the user did get to see the "Printing..." dialog twice. It's deja vu all over again.

HTH
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform