Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Total page to printer

Status
Not open for further replies.

dotnik

Programmer
Nov 14, 2003
24
IT
Good morning,

Can I know then total page's number set to printer?
f.e. I must print four copy of a document and on every copy I want to print 1(,2,3, or 4) of 4.

Thanks

Best regards
Nicola Francione
S&A - Software & Automation
Matera - South Italy
 
Hi Nicola,

What version of VFP are you using? If you have 8.0 or above, you can get the number of pages from the _pagetotal system variable.

With 7.0 and below, it's a little more complicated. For details, please see (look for the question: I would like to include page numbers in my report, in the form, "page x of y", where y is the total page count. Is this possible?)

Hope this helps.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
hello,

I'm using vfp 6.
I don't want to print four different page of a document, in this case your solution is true, but I must print 4 copy of a document.

Thanks
Nicola
 
Nicola,

in this case your solution is true, but I must print 4 copy of a document.

No. You don't actually print the copy. Using this code:

Code:
REPORT FORM MyReport NOCONSOLE

the report doesn't get printed anywhere. The report code is executed, but there is no output of any kind.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
"I must print four copy of a document and on every copy I want to print 1(,2,3, or 4) of 4."

Using the 'standard' Windows Print Drivers, have the VFP application issue each individual print copy by use of a FOR Loop.

Code:
* Example
FOR CopyCntr = 1 TO 4
   SELECT MyRptData
   GO TOP
   REPORT FORM MyReport NOCONSOLE TO PRINT
ENDFOR

In this manner, the VFP application would 'know' when each individual copy was sent to the printer.

Assuming that your Report Form had a TextBox on it that would print the CopyCntr value you could then print the Copy Number on each report.

Good Luck,
JRB-Bldr
 

Nicola,

Reading JRB-Bldr's reply made me think I have misunderstood your question. I thought you wanted to print the page number as 1 (or 2, 3, 4) of 4.

But maybe you wanted to print the copy number. If so, my apologies.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike is correct, the original question is somewhat confusing.

If you want to print the page number,
PageNumber of TotalPages
then his approach is the one to use.

If you want to print the copy number,
CopyNumber of TotalCopies
then you might want to use my approach.

If you need both, combine the two.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top