DOCUMENT:Q125967 10-FEB-2000 [foxpro] TITLE :HOWTO: Printing Labels in FoxPro Windows to a Dot Matrix Printer PRODUCT :Microsoft FoxPro PROD/VER:WINDOWS:2.5,2.5a,2.5b,2.6,2.6a,3.0,6.0 OPER/SYS: KEYWORDS:kbvfp ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual FoxPro for Windows, versions 3.0, 6.0 - Microsoft FoxPro for Windows, versions 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 ----------------------------------------------------- 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. 8. Enter the correct measurements for width and length. and click OK. You will return to the printer setup dialog. 9. From the third drop down list, select tractor. 10. Ensure that the Orientation is set to Portrait, and then click OK. 11. 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: Q157172 How to Create Custom Forms in Windows NT 4.0 Create a FoxPro Report to print the labels: 1. In the FoxPro Command window, enter this command: CREATE REPORT 2. 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. 3. Close the page header and footer bands; they are not required. This leaves the Detail band. 4. Place the fields and text into the Detail band, arranging them in the usual way. 5. Save the report. 6. Call the report either from the main FoxPro menu or from within a program. Additional query words: skip perforation avery LQ kbvfp300 kbvfp600 kbprinting ====================================================================== Keywords : kbvfp Technology : kbVFPsearch kbAudDeveloper kbFoxproSearch kbFoxPro260 kbFoxPro250 kbFoxPro250a kbFoxPro250b kbFoxPro260a kbVFP300 kbVFP600 Version : WINDOWS:2.5,2.5a,2.5b,2.6,2.6a,3.0,6.0 Issue type : kbhowto ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 2000.