The information in this article applies to:
- Microsoft Visual FoxPro for Windows, version 3.0
- Microsoft FoxPro for Windows, version 2.5, 2.5a, 2.5b, 2.6, 2.6a
SUMMARY
This article shows by example how to print labels in FoxPro for Windows to
a dot matrix printer.
MORE INFORMATION
Usually, the label format causes page ejects at the end of each page of
labels. These appear as blank lines after a few continuous labels have
printed, which causes subsequent labels to move out of alignment. This
effect is caused by a combination of the label format file and the dot
matrix printer driver settings. To overcome this effect, you must adopt a
different approach to the label-printing process when using dot matrix
printers and continuous labels.
Steps to Follow to Print Labels on Dot Matrix Printer
- In the dot matrix printer driver, set a user-defined paper size to
represent the label dimensions. Make the length dimension include the
distance from the top of one label to the top of the next label.
- In the application, ensure that the user accesses the Printer Setup
Dialog by using the Print Manager icon or the Control Panel Printers
icon. If the user accesses the Printer Setup Dialog from anywhere else,
the dialog will not allow the user to set a user defined paper size.
- Ensure that the selected Paper Source is set to Tractor and that the
Paper Orientation is set to Portrait.
- In FoxPro, create a normal REPORT FORMAT rather than a label REPORT
FORMAT.
- From the report layout, select single column.
- Using the printer setup button, select the correct printer driver.
- Return to the report builder. The dimensions of the visible report will
have changed to reflect the paper size that was set in the printer
driver setup.
- Place the appropriate fields on the report where required and call this
report in the usual way.
Step-by-Step Example
Windows 95 setup for the correct printer driver paper size:
- From the Windows Control Panel, select the Printers Icon.
- Select the correct driver for your printer from the Installed Printers
list.
- Click the Set as Default Printer button.
- Click the Setup button on the right hand side. The printer setup dialog
opens.
- From the first drop down list, select the printer resolution.
- From the middle drop down list, select User Defined Size for the paper
size.
- When the mouse button is released, a user-defined size dialog will open.
The width and length measurements within this dialog refer to the width
and length of the paper size, which for this example is that of a single
label.
NOTE: As mentioned earlier in this article, the label length is the
total distance from the top of one label to the top of the next label
including any space between the two labels.
- Enter the correct measurements for width and length. and click OK. You
will return to the printer setup dialog.
- From the third drop down list, select tractor.
- Ensure that the Orientation is set to Portrait, and then click OK.
- Close the Printers Selection dialog; then close the control panel.
Windows NT setup for the correct printer driver paper size:
If the computer is running Windows NT 4.0, a different process must be
followed to set up a custom paper size. In NT 4.0, these custom paper sizes
are called custom forms.
For more information about creating custom forms, please see the following
article in the Microsoft Knowledge Base:
ARTICLE-ID: Q157172
TITLE : How to Create Custom Forms in Windows NT 4.0
Create a FoxPro Report to print the labels:
- In the FoxPro Command window, enter this command:
CREATE REPORT <report name>
- From the Report menu option, select page layout. You will see that the
page dimensions will now equate to the size of a single label.
- Close the page header and footer bands; they are not required. This
leaves the Detail band.
- Place the fields and text into the Detail band, arranging them in the
usual way.
- Save the report.
- Call the report either from the main FoxPro menu or from within a
program.
|