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

Print Mulitple Copies 2

Status
Not open for further replies.

Ed Andres

IS-IT--Management
Mar 27, 2001
142
US
Is there a way to print multiple copies of a report without having to loop the REPORT FORM command? I would like to have the user define the number of copies from a form entry and then print that many copies passing the qty along.

Any help is appreciated,

Ed
 
How abt this ...

Assuming txtNumberOfCopies is the name of the textbox where user will enter.

lnUserDefinedValue = THISFORM.txtNumberOfCopies.Value
FOR n=1 to lnUserDefinedValue STEP 1

REPORT Command

ENDFOR
 
Thanks for the speedy reply but I was trying to avoid the looping (FOR...ENDFOR). It does work but the environment I am in puts a fairly long delay (2-3 seconds) between copies.

What I am doing is trying to print part labels to a label printer that will print a label in about a second when connected directly to the computer or in close proxmity to the server or switch. Out at the end of the network, it creates the delay. So, printing one or two is not bad but when you print 50 that goes from about a minute to over three.

I am working on the network infrastructure but if I could send one print job that has 50 copies, that would be best.

Thanks,
Ed
 
Try REPORT FORM report1 TO PRINTER PROMPT

PROMPT will bring up the print dialog box. The user can select the number copies there. I think that will surely create single print job.

Let me know if this helped you.
 
I thought of the PROMPT but was trying to avoid the user to have to think too much. You know how they can be. This will have to do until I can come up with something else.

Thanks for your help!

Ed
 
eandres

If you always need the same amount of copies, hack you report (use it as a table) and set the number of required copies in the EXPR field. Here is the info in my report:
use myReport.frx
browse


*****************
DRIVER=WINSPOOL
DEVICE=HP LaserJet 4Si/4SiMX PS
OUTPUT=\\msprint32\privj
ORIENTATION=1
PAPERSIZE=1
PAPERLENGTH=2794
PAPERWIDTH=2159
SCALE=100
COPIES=1 && Change this to 2 or 3 or whatever.
DEFAULTSOURCE=7
PRINTQUALITY=600
DUPLEX=1
YRESOLUTION=600
TTOPTION=3
******************* Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
To take mikes suggestion a stage further there is nothing to stop you doing this on the fly, I will certainly be trying this

Rich
 
clarkrj

To take an FAQ I wrote a while ago (faq184-1934) to change printer tray on-the-fly and adapt it to this situation
Code:
DO MULTIREPO WITH "C:\MYREPORT.FRX", 2 

LPARAMETER lcFRX, lnCopies
LOCAL lcNewExpr, lnStartCopiesLine, lcStartAtCopiesLine, lnEndCopiesLine ;
	lnLenCopiesLine, lcTop, lcBottom
#DEFINE vfCRLF CHR(13) + CHR(10)

IF !(UPPER(RIGHT(lcFRX, 4)) = ".FRX")
	lcFRX = lcFRX + ".FRX"
ENDIF
USE (lcFRX)
LOCATE FOR objType = 1 AND objCode = 53

IF EMPTY(EXPR)

        lcNewExpr = "COPIES=" + ALLT(STR(lnCopies)) + vfCRLF
ELSE

        lnStartCopiesLine = ATC("COPIES", EXPR)
        lcStartAtCopiesLine = SUBSTR(EXPR, lnStartCopiesLine)
        lnEndCopiesLine = ATC(vfCRLF, lcStartAtCopiesLine)
        lnLenCopiesLine = LEN(SUBSTR(lcStartAtCopiesLine, 1, lnEndCopiesLine))
        lcTop = SUBSTR(EXPR, 1, lnStartCopiesLine - 1)
        lcBottom = SUBSTR(EXPR, (LEN(lcTop) + lnLenCopiesLine))
        lcNewExpr  = lcTop + "COPIES=" + ALLT(STR(lnCopies)) + lcBottom

ENDIF

REPLACE EXPR WITH lcNewExpr
USE IN (lcFRX)
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Yes, Thanks Mike!

I will definately give this a try.

Ed
 
Hey Mike,

that is really a nice solution.. !!! I think u deserve a star on this.. !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top