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!

printing labels in vfp 9.0

Status
Not open for further replies.

dougerstew

Programmer
May 30, 2003
54
US
Hi Smart People,
I just got 9.0 with sp2, and i am having a couple of problems printing.

I am printing 4 labels across on 13.6" wide paper.
I have a simple database with 15 fields that are 52 characters each. The label form just prints these fields "as is". In foxpro 2.6 for windows, the alignment was fine, but now the alignment of fields is off. It is off on the entry screen and off on the printouts. Can someone tell me how to fix this, or point me to another thread that does this?

example
PURE SEED GERMINATION ORIGIN
44.71% GRASS SEED TYPE1 90% OREGON
34.31$ GRASS TYPE 2 85% OR/WA

ETC

show on screen and prints as (not exactly like this, but misaligned)
PURE SEED GERMINATION ORIGIN
44.71% GRASS SEED TYPE1 90% OREGON
34.31$ GRASS TYPE 2 85% OR/WA

(Sorry if they don't seem different after I post - the spacing is off on the 2nd one as I type it, but when I preview it they look the same).

Also, it was a problem in 2.6 and is still a problem now. I changed the windows printer setup to default to a form of 13.6" X 2", but when I go to print, it reverts back to letter, and i have to change it before printing. How do I get the 13.6 X 2 to stay when I print?

thanks
Doug

 
It sounds like you're trying to use spaces for alignment.

Aside from being the worst possible way even when it was all we had it won't work once you graduate to proportional fonts.

I suspect you're not using LABEL FORM, but you should be. That'll handle placement/alignment for you.
 
If you should happen to Not be using a Label Form, you might want to do a Google search for: vfp "modify label"

There are a number of 'finds' there which might guide you on how to use that approach to printing labels.

Good Luck,
JRB-Bldr
 
Thanks for the feedback Dan and JBR. I was using report form, not label form, but it didn't seem to make a difference. Sounds like i need to break down and redo the database to separate each line into separate fields, which presents some other issues. But I can work on that.
Any ideas on how to make the windows printer setup stick?
 
redo the database to separate each line into separate fields
Well you can certainly do that.

Or you can build an 'as needed' Cursor with the necessary data in the separate fields just to print the Label/Report

Example:
Code:
* --- Create 'As Needed' (Temporary) Record Set From 'Master' Data Table To Use For Label Printing ---
SELECT LEFT(Field1,20) as Line1,;
   SUBSTR(Field1,21,20) AS Line2,;
   SUBSTR(Field1,41,20) AS Line3;
   FROM MyData;
   WHERE <whatever you want>;
   INTO CURSOR LabelData READWRITE

* --- Print Label(s) ---
SELECT LabelData
LABEL FORM ThisLabel NOCONSOLE TO PRINT

Good Luck,
JRB-Bldr



 
Hi Doug,

A couple of points:

You said: I changed the windows printer setup to default to a form of 13.6" X 2", but when I go to print, it reverts back to letter, and i have to change it before printing. How do I get the 13.6 X 2 to stay when I print?


Where are you setting the form size? If you are doing it in the Windows printer dialogue (which you get to when you select Print from the File menu, or if you issue REPORT FORM .... TO PRINTER PROMPT), then the report won't remember that next time. You need to do in the report designer: Go to File / Page Setup, and then click the Page Setup button. You might also need to tick the "Save printer environment" box next to that button.

Sorry if they don't seem different after I post - the spacing is off on the 2nd one as I type it, but when I preview it they look the same.


To preserve your spacing in the forum post, use the "code" tags. Either highlight the text, and click the Code button in the editor's toolbar (on my system, it's between the Quote and the Spoiler buttons), or type [ignore]
Code:
 and
[/ignore] tags around the text.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
>Sounds like i need to break down and redo the database to separate each line into separate fields

Well, you can also simply choose a non proportional or monospaced font in the report designer. Simply select your report control (it should only be one for the whole line, as you have your data in one field), right click, choose Proerties and in the style tab choose "Courier New" font and that will print such data aligned again. Don't make it too complicated for the start.

Anyway, it's a good idea in the long run to separate data for the separate report columns, to be able to use proportional fonts for a better final look, but in the start a simple font change is all you need.

Bye, Olaf.
 
If you're just changing the font, there's no need for the LABEL FORM either. This should probably do it:

Code:
SET PRINTER FONT "COURIER NEW",10

Of course, then you're still using spaces to align text, just as if you were using a manual typewriter.
 
thanks for all the input. I was able to change the font to courier new, but had to change the size to 7 to get everything to fit on the label. this unfortunately makes it less legible that it used to be. Any other thoughts? is there perhaps another font that would work? i've also tried to print using the command prompt after printing to a text file, but this new version doesn't seem to be able to make it happen.
 
I was able to change the font to courier new, but had to change the size to 7 to get everything to fit on the label. this unfortunately makes it less legible that it used to be. Any other thoughts? is there perhaps another font that would work?

That's right. Courier New is a fairly expanded font, which means it takes up a relatively large amount of horizontal space. What you need is a more condensed font.

I can't suggest any specific fonts to use, because I don't know what you have on your computer. The following is a list of some of my own monospaced fonts. If you have any of these, try doing a sample so you can pick one you like:

Andale Mono
FixedSys
FoxFont
Lucida Console
Lucida Sans Typewriter
MS Mincho
Terminal

Back in Windows 95 and 97, it was possible to sort the fonts in the Fonts window (accessible from Control Panel) into monospaced and proportional, but that seems to have disappeared. No doubt there are free utilities you can download that will do the job for you.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top