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

Printer parameter

Status
Not open for further replies.

JeanPhil

Programmer
Dec 23, 2003
27
CA
Ok I am not realy good with FoxPro and I have a problem. I need to modify the code in a program someone else did and I don't know how. The program create a text file that is used for printing checks. I understand the code part but I have a problem with the top margin of the print. The program used to print on an old matrix printer and we switch to laser so I can't adjust the top margin manualy anymore. Is there a way to change the value of the top margin for the print with the Foxpro code. Any idea would be greatly appreciated cause I'm kinda lost now. If you need code sample feel free to ask. Thanks.
 
"I need to modify the code in a program someone else did."
"The program used to print on an old matrix printer."

The first question is what version of Foxpro is this application written in. Your mentioning the old matrix printer might suggest that it was written in one of the Non-Visual Foxpro versions.

If it was one of the Foxpro for DOS versions, your approach will be different than it might be for Foxpro for Windows or Visual Foxpro.

The next question is how is the report being generated? Through use of 'hard code' such as @Row,Col SAY <whatever> or through use of the Foxpro Report Designer.

If the Report Designer, then you need use Foxpro and go into the Report and change it as needed.

If it is 'hard coded' then you can adjust where the first line is printed by inserting (or removing) blank lines.

Good Luck,
JRB-Bldr
 
Thanks for the quick anwser.

The program is in Visual FoxPro 4 or 5 .. not sure but it's not for DOS.

The print is hard-coded to create a .txt file that is sent directly to the printer.

Ex :

SET ALTE TO temp\CHEQUE
SET ALTE ON
SET CONS OFF

...

? space(60),database_field_x
? space(60),database_field_y
?
? database_field_z

...

RUN TYPE temp\CHEQUE.TXT >LPT1



The problem is that there is no empty line in the begining of the code, but the first line is to far down when the file is printed. I need it to be a couple of line up but there is no line for me to play with. Thats why I tought of the top margin. The file is printed on a check (as in pay check) sheet and I can't modify that. Any idea ?
 
Since there were no empty lines in your original code, the program must have been depending on someone manually setting the Top Of Form in the old dot matrix printer.

You are correct in that most laser printers have a built-in top margin of more or less 1/2 inch. This is to take into consideration the toner fusion bar dimensions, etc.

Some laser printers can squeeze the margin space down somewhat, but I have not personally seen one that can eliminate it totally. Maybe some other forum user has.

If I were to attempt to do this job, I would first create a VFP Report Form (MyReport) to do the job and then "toss out" the original print code to be replaced by a
REPORT FORM MyReport NOCONSOLE TO PRINTER

It would then be a WHOLE LOT EASIER to maintain the report parameters.

It would not totally get around the margin issue, but you could then use the Windows Printer Properties to modify as much as you can to do the job.

One way to test your new laser printer is to attempt to print to it using a non-VFP application such as Excel or Word. Modify the margins in the Printer Setup and look at the output. That should let you know just how much flexibility you have in margin settings.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top