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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can i command to my report to print a certain no of copies?

Status
Not open for further replies.

MY3MCS

Technical User
Apr 17, 2003
49
0
0
GB
Hello everyone:

I call my printing command from a button as this:

REPORT form "reportname" noconsole to print.


Suppose I want to print it in 3 copies, how would i do it? Do I have to type the above command 3 times? Or is there any other way to do it?

Thanks...


 
MY3MCS

You can hack your report and use it as a table, and change the information in the Expr field (in the first record), where the printer information is stored and change the number of copies there (that is if you always want 3 copies).
Or depending on what version of VFP you are using you can use the ? SYS(2037).

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks mike. It looks interesting but unfortunately I don't know how to do it (hacking). I'm using VFP version 5 for your information.
 
You can also do something like:

FOR nCopies = 1 TO nSomeVar
REPORT form "reportname" noconsole to print
NEXT

Where nSomeVar can be a preset number or say, a spinner control on a form.


-Dave S.-
[cheers]
Even more Fox stuff at:
 
MY3MCS

It looks interesting but unfortunately I don't know how to do it (hacking).

Use your report like a table (which it is) and go to the first record (go top) and look in the Expr field.

USE myReport.frx
go top
browse

You should see something like this (and you can change the number of copies)

DRIVER=WINSPOOL
DEVICE=IBM 4039 LaserPrinter Plus
OUTPUT=LPT1:
ORIENTATION=1
PAPERSIZE=1
COPIES=1
DEFAULTSOURCE=2
PRINTQUALITY=600
DUPLEX=1
YRESOLUTION=600
TTOPTION=4

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi MY3MCS

REPORT form "reportname" noconsole to printer PROMPT

The additional word prompt will allow you to bring up a Printer choice window by VFP. You will get a choice to select the number of copies.

Daves choice is simple but it has some issues of processing the report n number of times. May be you may have to choose.. LOCATE or GO TOP within that loop so that the report starts from first record (if the data environment of report is default).

Mike's approch is the best. If you want to read on this in detail or get some readymade code, look in..


:)

ramani :)
(Subramanian.G)
 
HI,

My humble opinion would have to suggest Dave's approach to the issue. If the report is part of a compile app, the report would have to exluded from the project and made available to the user. This can can become difficult to maintain, or worse yet, users that have access to Foxpro and find the file might modify it, then blame you when it blows up-

A couple of addition suggestions of things that I have used especially when the number of copies is always going to be the same- such as an invoice printer where triple copies may be required. These have worked for me, but may not fit your situation.

1- Create a copy of the report, set the number of copies required to print in the report, then let the user decide which one and when to use it.
2- Many printer drivers have an option of multiple copies. create a copy of the installed printer (HP 5L-3copies) setting the number of copies to print the issue a "Set printer to ...." prior to processing the report.

Good luck
HJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top