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!

POS Receipt Printer help 1

Status
Not open for further replies.

FoxWing

Programmer
Dec 20, 2004
44
GB
Hi,

I'm doing a new system using Foxpro 8 which is printing receipt using a POS printer. However, i encouter 2 problems :

1) Every printing ends with a big gaps ending up almost an A4 size length. What paper size should i set ? The receipt paper is 76x76x12

2) I unable to cut the paper. I'm using Foxpro report writer. In the footer of the report, i put a field with an expression : CHR(27) + "i". It doesn't work. However, the old system using Foxpro as well, uses "cputs" command it it cuts with the same printer.

Any advise will be much appreciated.

Thanks.

 
FoxWing

Have worked on a couple of POS system, I have found that I was better off using the ??? (older style of sending info to the printer) to produce a receipt, rather than a report.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I just had a go with ???.

Working fine except that the page still scroll after printing a line.

Example :

SET PRINTER TO NAME \\U001152\kitchen(1)
??? "testing"

The result : "Testing" word was printing and followed by at least 40 empty lines along.

Any idea ?



 

Then the problem is related to your printer not vfp. You have to take the owner manual and figure out the escape codes required to prevent a pagefeed, or noeject.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Alright, i solved the ejecting problem.

Now, i have a doubt is my approach is correct when using ???

Example :


SET PRINTER TO NAME \\U001152\kitchen(1) <-- set printer
??? "TESTING" + CHR(13)+CHR(10) <--- not printing yet
??? CHR(27) + "i" <--- not printing yet

SET PRINTER TO NAME \\U001152\kitchen(1) <-- now only it prints.


Is this how it should be ? I thought "???" is sending to printer and print instantly, but it's not ?

Please advice.

Many thanks


 
I have seen this behavior before, have you tried:
Code:
SET PRINTER TO NAME \\U001152\kitchen(1) 
SET PRINTER TO NAME \\U001152\kitchen(1)
 ??? "TESTING" + CHR(13)+CHR(10) 
 ??? CHR(27) + "i"




Mike Gagnon

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

Still no luck, unfortunately.

Thanks

 
Try this then

Code:
SET PRINTER TO NAME \\U001152\kitchen(1) 
 ??? "TESTING" + CHR(13)+CHR(10) 
 ??? CHR(27) + "i" 
SET PRINTER TO

But this will have the same effect as your original situation.


Mike Gagnon

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

Yeap, that will work.

Should i send all the output at once before print or print line by line ?

Example :

SET PRINTER TO NAME \\U001152\kitchen(1)
xxxxxxxxxxxxx <--- print 10 lines.
yyyyyyyyyyyyy <-- cut paper
SET PRINTER TO

OR

SET PRINTER TO NAME \\U001152\kitchen(1)
xxxxxxxxxxxxx <--- print line 1
SET PRINTER TO

SET PRINTER TO NAME \\U001152\kitchen(1)
xxxxxxxxxxxxx <--- print line 2
SET PRINTER TO

SET PRINTER TO NAME \\U001152\kitchen(1)
cut paper
SET PRINTER TO

 

I would accumulate the data and send in 1 shot.


Mike Gagnon

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

Glad it worked out.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top