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:
00037714
Vues:
37
>>>
>>> >>>
>>> >>>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
>>> >
>>> >serious work around. i think i'd stick to crystal reports.
>>>
>>> Besides, the number of lines per page in a text file, may or may not match
>>> the number output to the printer due to differences in font height.
>>
>>Oh. This is going to a Text file? This changes things.
>>
>>Have a label with the text "Page"
>>Have a field with the value "_pageno"
>>Have a label with the text "of {PAGES}"
>>Have a call to the SetPage UDF that is included above.
>>Print the report to the text file.
>>
>>create cursor temp (memofield m)
>>append blank
>>append memo memofield from {filename}
>>m.file = fcreate("output.filename")
>>if m.file > 0
>>
>>=fwrite(m.file,strtran(temp.memofield,"{PAGES}",alltrim(str(m.nNumPages))))
>> =fclose(m.file)
>>endif
>>use in temp
>>
>>Ok, so this will take an extra few steps. But it will reliably update
>>the number of pages.
>>
>>/Paul
>
>Paul,
>
>I think what the text file is being used for here is to determine the number of pages for use in printer output. If so, then I think the problem with point size remains.
>
>George

One thing I did was to add a end page column to the table I wuz printing out. I knew that I would display 30 rows per page with no fields that wrapped. So the math was simple to back fill in the end page column of my report table. Otherwise, running the report may be your only option... htwh
Steve Medvid
Systems Analyst

Environmental Resource Management
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform