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

How to print multiple copies of same report

Status
Not open for further replies.

lorel

MIS
Jun 15, 2004
158
Hi there!
I have a client who wants to print several copies of the invoices in a laser printer. he does not wants to use a dot matrix with carbon paper.
I did something similar to this several years ago, but I can not remember how i did it.
Upon my research a found a property, PRINTER{PRINTPRO:COPIES} = number that supposedly does this, but I do not know were to add this line and the example is vague.
Can any one recommend a way in which the client can print several copies of the same invoice? Is there some setting that will direct the printer to print, lets us say, 3 copies when the invoice is send to the printer?

Thanks

Joe

PD I am using Version 6.3
 
Hi Joe,

If you are using PRINTER{PROPPRINT:Copies}, it is before OPEN(Report). Or, if you are using Report{PROPPRINT:Copies}, it is before Print Preview Display.

But make sure your printer supports it.

Regards
 
I called Softvelocity and Robert in support help me out with this problem. Now the client (like they all do) wants more, they have asked me to put a different message in each copy.

For example , copy one is to say "Original" second copy is to say " Accounting", third copy "Warehouse" Etc. I told the client that this may not be possible. I have no idea how to do this and not even sure it can be done.

Any ideas?

Thanks

Joe
 
Hi Joe,

The only way to do that is to print the page multiple times and edit the WMF files (preview pages) directly after they are generated and before they are printed. Given below is the code to do a Page N of M modification and you can adapt it accordingly.

Data Section ::

WMFFile FILE,DRIVER('DOS'),PRE(WMF),NAME(GLO:WMFName)
RECORD RECORD
Data STRING(65536)
. .

Code Section - Before Previewer.Display or ThisWindow.AskPreview.

!~! Page No Manipulation
L# = RECORDS(PrintPreviewQueue)
LOOP C# = 1 to L#
Get(PrintPreviewQueue,C#)
CLOSE(WMFFile)
GLO:WMFName = PrintPreviewImage
OPEN(WMFFile)
IF NOT ERRORCODE()
S# = BYTES(WMFFile) ; P# = 1
LOOP
GET(WMFFile,P#)
IF ERRORCODE() THEN BREAK.
B# = BYTES(WMFFile)
Upd# = 0
IF L# > 1
I# = INSTRING('Continued on Next Page ...',WMF:Data,1,1)
IF I#
WMF:Data = WMF:Data[1:I#-1] & 'Continued on Page' & FORMAT((C#+1),@N2) & ' ......' & WMF:Data[I#+26:B#]
Upd# = 1
END
END
I# = INSTRING('Page :nn of nn',WMF:Data,1,1)
IF I#
WMF:Data = WMF:Data[1:I#-1] & 'Page :' & FORMAT(C#,@N2) & ' of ' & LEFT(FORMAT(L#,@N2),2) & WMF:Data[I#+14:B#]
Upd# = 1
END
IF Upd#
PUT(WMFFile,P#,B#)
IF ERRORCODE()
MESSAGE('Error Writing WMF Preview File','E R R O R',ICON:Question,BUTTON:Ok)
END
END
P# += B#
IF P# => S# THEN BREAK.
END
CLOSE(WMFFile)
ELSE
MESSAGE('Error Opening WMF Preview File','E R R O R',ICON:Question,BUTTON:Ok)
END
END
!~!

Regards
 
Have you tried simply calling the Windows PrinterDialog and telling it the number of copies to print. I have not tested this with all apps but it has worked for me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top