Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Page length problem
Message
From
11/03/2004 18:53:16
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Page length problem
Miscellaneous
Thread ID:
00885441
Message ID:
00885441
Views:
68
I have taken-over an 'old' FoxPro DOS application which I have updated to run under VFP7, but still uses hand-coded reports which start...

SET DEVICE TO PRINT
SET PRINTER TO NAME "INVOICE1"
SET PRINTER FONT 'COURIER NEW',11
??? CHR(27)+'x0' && draft
??? CHR(27)+'@' && reset printer
_pagelen=66

@1,1 SAY ...
@2,3 SAY ...
and so on...

EJECT

---------------------------

All reports are to be printed on 3-part continuous fan-fold paper with a page length of exactly 11 inches. The printer is a EPSON LQ300 dot-matrix printer.

Some pages are ejecting on 62 lines, some on 68 - there is no consistency which I can pinpoint. At present it is a pain for the user to only print one invoice or one statement at a time, resetting the paper loader, printing another invoice, etc.. This defeats the whole idea of using continuous paper!

For the printer commands that do not have Foxpro commands (eg. set bold on/off) ??? commands are used. Could it be the mixture of Foxpro (eg. _pLength) and ??? commands that is causing the problems? Is it ok to use _plength outside of a PRINTJOB/ENDPRINTJOB (I have not used these latter commands)? Should I always use ??? commands in preference to _plength, eject, etc.?

BTW, the printer manual states that the escape code for setting page length is ESC Cn, where n is the no. of lines per page. Does this mean the sequence in Fox is CHR(27)+'C'+CHR(66), or CHR(27)+'C66'?

I could send all reports to a text file using SET DEVICE TO printfile.txt, then print the file using TYPE printfile.txt TO PRINT, but is it any easier to control the page length this way?

This DOS-style printing is becoming a headache, so any advice would be appreciated. I've already suggested redesigning the reports in VFP, but the budget will not stretch that far.


Alan Harris-Reid
Next
Reply
Map
View

Click here to load this message in the networking platform