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

Using printer tray

Status
Not open for further replies.

raspoutine

Programmer
Sep 28, 2001
13
FR
I use a laser printer and I wish to print an invoice by using the 2 trays.
The original coming from the 1st tray and copies from 2nd tray

Which command must I use ?
 
There is nothing "native" in VFP to control printers like this. I've seen advertisments for 3rd party programs that claim to be able to do something like this. (You might find something at
One trick, would be to distribute the report outside of the project and change the Tray info (and number of copies?) in the FRT between the first and "second" printing. Note: Because printer information can be stored differently for different printer types, this is probably not a "generic" solution.

Rick
 
Hi

1. Do not include the report file in the project. Instead keep the report file .. say.. invoice.frx and invoice.frt in some suitable directory or along with the executable.

2. In your invoice printing routines... add the following code..

** Copying and using is just a matter of my preference .. so that the report files never get corrupted.

rptFile = SYS(3)
COPY FILE "INVOICE.FRX" TO rptFile+".FRX"
COPY FILE "INVOICE.FRT" TO rptFile+".FRT"

USE rptFile+".FRX" IN 0 ALIAS rptFile
GO TOP IN rptFile
REPLACE rptFile.Expr WITH "", rptFile.Tag WITH "", rptFile.Tag2 WITH ""
** set paper tray to upper bin
REPLACE rptFile.Expr WITH "DEFAULTSOURCE=1"
USE IN rptFile
**
** Print the first copy of invoice
REPORT FORM (rptFile) NOCONSOLE TO PRINTER
**
USE rptFile+".FRX" IN 0 ALIAS rptFile
GO TOP IN rptFile
REPLACE rptFile.Expr WITH "", rptFile.Tag WITH "", rptFile.Tag2 WITH ""
** set paper tray to lower bin
REPLACE rptFile.Expr WITH "DEFAULTSOURCE=2"
USE IN rptFile
**
** Print the second copy of invoice
REPORT FORM (rptFile) NOCONSOLE TO PRINTER
** DEFAULTSOURCE=3 is middle bin.

** Now clean up
DELETE FILE rptFile+".FRX"
DELETE FILE rptFile+".FRT"
**
Hope this helps you :) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top