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!

How to Design Dot Matix Report - 17 Chars/Inch

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
OK, I used to do this all the time back in the DOS days. I need to design a VFP 9 report that is 4.25 High and 11 inches wide with a fixed font of 8 Lines/Inch and 17 Chars/Inch. I'm using an Oki printer. I've managed to set the defaults on the printer to 8 Lines/Inch and 17 Chars/Inch. I'll wotty about the form length later. How do I use the report designer to make this report. I can specify the Couurier font, but how do I change it to 17 char/inch to be able to see the format on the screen? I have set up a Generic Text Only printer. Am I missing something in the report designer that will let me do this?

Auguy
Sylvania/Toledo Ohio
 
If you are now using VFP9, you should be using the VFP Report Form to layout your reports.

With the Report Form, if you want different than the Default values, you select the individual Font properties (Bold/Italic/etc, Font Size, etc.) for each Report Form Textbox

Good Luck,
JRB-Bldr
 
Yes, I am using the VFP 9 report writer. I can change the font size, but that doesn't change the pitch (17 Char/Inch). Maybe I'm dreaming but I thought I could do this in the old FoxPro DOS days.

Auguy
Sylvania/Toledo Ohio
 
I thought I could do this in the old FoxPro DOS days

In the OLD days, you most likely sent a printer-specific command string to the printer to change its internal settings. That might have included the Pitch.

If that is how you did it WAY BACK WHEN, you can still issue PCL (Printer Command Language) commands to the printer. You can create your own User Defined Function (UDF) to issue the command(s) and then call that function either from your application or from within the Report Form itself.
Do a Google Search for 17 cpi okidata

Another way might be if you were to find an alternate font to use which, by its own nature, uses a different pitch.
Do a Google Search for font 17 cpi pitch

Good Luck,
JRB-Bldr


 
Auguy,

The answer is that you shouldn't use the Generic Text Only printer driver. Asuming your printer has a proper driver for Windows, you should set up the report in the Report Designer, the usual way.

You can still use fixed-pitch fonts if you like. Just apply the font in the Report Designer as usual. You can either use any TrueType fixed-pitch fonts you have installed (such as Courier New), or the printer's resident fonts.

As far as font size is concerned, you will have to experiment a bit to figure out which point sizes correspond to which cpi values. As a general guide, for Courier New, 10 pt corresponds to 12 cpi, and 14 pt corresponds to 8.5 cpi. But those figures will be different for other fonts.

This means that you won't have to worry about sending special codes for lines per inch, lines per page, and so on.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Thanks Mike, I'm somewhat confused. Where do I set up the form length, in the report's Page Setup, user defined size? Do I have to make a special sized form in Windows first? Also, if I use the regular driver for the OKI dot matrix, isn't that going to be really slow printing?

Auguy
Sylvania/Toledo Ohio
 
Setting the form length: Yes, you do that in Page Setup. But if you are using the correct OKI driver, it probably won't be a custom size. The driver will know all the standard sizes for the printer.

If you don't see the correct form length in Page Setup, then you probably will need to set up a custom size.

Re slow printing: If you use scalable fonts (like TrueType), then the printer is going to have to render each character from an array of dots, which will indeed be slow. But if you use the printer-resident fonts (which the driver should know about), then it will be as fast as using the generic / text driver.

And it occurs to me that if you do use the printer-resident fonts, you might not need to convert from points to cpi, as the printer driver might display the cpi along with the font name (but that varies with the driver).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Set a matrix impact printer by default in Windows.

Create a repor form in VFP. Menu Edit / Selec All (inside repor desing). Then apply Font Draft17cpi font.
This font are only availables if a matrix printer is selected.
 
MarsNW,

Thanks for your input, but I think we've already got that far.

Also, I don't see why you say to set the dot matrix printer as the default in Windows. You can still select it in the report designer in VFP regardless of the Windows default.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
OK, got most everything working except the form feed. I have my custom form set up as 8.00 wide and 4.25 high (Inches) and it is selected in the report properties page setup. When I run the report it gives me a form feed like it's 11 inches tall. I've reset my grouping from new page to new line with no effect. The report seems to recognize the smaller form height because it prints the fields I have in the page footer at about the right position.

Auguy
Sylvania/Toledo Ohio
 
Think I've got it, had to set the grouping to New Page Number 1

Auguy
Sylvania/Toledo Ohio
 
Oops, spoke too soon, still having problems with page eject between groups and have tried numerous combinations of settings. If I send
Code:
???chr(27)+chr(67)+chr(34)
to the printer for 34 lines on the form, it works after I print a couple of tickets. But if I turn the printer off and on it doesn't work until I print a few more tickets????. It's like it's completely ignoring the custom page length.


Auguy
Sylvania/Toledo Ohio
 
Auguy,

You say you've almost got it working, but you don't say if you are still using the generic / text only driver, or the specific driver for this printer as I advised.

If the latter, then you should not be sending escape sequence. The printer driver will ignore them.

If you are using the generic / text only driver and you send an escape sequence that changes a setting in the printer (including the page length), then that setting only stays in force while the printer is switched on. If you switch the printer off and on again (or reset the printer), then obviously you will need to send the sequence again.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Yes, I am using the printer driver for the OKI, but when I run the report for the first time, it gives me form feeds like it's 11 inches tall. If I run it again then it gives me the proper page feeds. Maybe it's a printer problem.

Auguy
Sylvania/Toledo Ohio
 
Given that you're using the OKI driver, you should definitely not be sending the escape sequences. In fact, you should never use the ??? command. You should rely entirely on the printer driver to handle the form feeds.

I doubt that there's anything wrong with the physical printer. It's more likely to be a fault with the driver, but even that seems unlikely.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
page eject between groups

As Mike says above you should NOT be attempting to use the '???' method of issuing a Page Eject.

Within your Report Form you should have the Groups configured so that each of them is printed on its own separate pages.

If you need extra 'lines' in order to 'trigger' a Page Eject, you should create additional records where needed within the Report Cursor/Table that you are passing to the Report Form.

Good Luck,
JRB-Bldr


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top