Microsoft KB Archive/125967

= How To Printing Labels in FoxPro Windows to a Dot Matrix Printer =

Article ID: 125967

Article Last Modified on 7/1/2004

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition
 * Microsoft FoxPro 2.5b
 * Microsoft FoxPro 2.5a
 * Microsoft FoxPro 2.5b
 * Microsoft FoxPro 2.6 Standard Edition
 * Microsoft FoxPro 2.6a Standard Edition

-



This article was previously published under Q125967



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

 * 1) 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.
 * 2) 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.
 * 3) Ensure that the selected Paper Source is set to Tractor and that the Paper Orientation is set to Portrait.
 * 4) In FoxPro, create a normal REPORT FORMAT rather than a label REPORT FORMAT.
 * 5) From the report layout, select single column.
 * 6) Using the printer setup button, select the correct printer driver.
 * 7) 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.
 * 8) 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:


 * 1) From the Windows Control Panel, select the Printers Icon.
 * 2) Select the correct driver for your printer from the Installed Printers list.
 * 3) Click the Set as Default Printer button.
 * 4) Click the Setup button on the right hand side. The printer setup dialog opens.
 * 5) From the first drop down list, select the printer resolution.
 * 6) From the middle drop down list, select User Defined Size for the paper size.
 * 7) 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.
 * 1) Enter the correct measurements for width and length. and click OK. You will return to the printer setup dialog.
 * 2) From the third drop down list, select tractor.
 * 3) Ensure that the Orientation is set to Portrait, and then click OK.
 * 4) 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:

157172 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  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.</ol>

Additional query words: skip perforation avery LQ kbvfp300 kbvfp600 kbprinting

Keywords: kbhowto KB125967

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.