How To Control Printer Attributes for a Report at Run TimeLast reviewed: October 18, 1996Article ID: Q133163 |
The information in this article applies to:
SUMMARYWhen designing a report, a developer does not always know which printer will be used. As a result, the developer needs to give the user a way to change the printer and printer attributes at run time. This article shows by example how to write code that does this.
MORE INFORMATIONVisual FoxPro has enhanced and added commands and functions for controlling and getting printer information. Please see the Help menu for more information on these commands:
SET PRINTER TO APRINTER() PRTINFO() GETPRINTER()The following example shows that a report can be sent to an HP LaserJet IIID on LPT2 with print duplex and landscape selected, and then the same report can be sent to a Panasonic KX-P1180 on LPT1 using a custom paper size. To run the example code, you must have the printers installed in Windows. If you don't, you need to install them, and set up a user-defined paper size under printer setup in Windows for the Panasonic. Set the user-defined size using Millimeters (MM) as the measuring unit with the Width at 2159 and the Length at 1778. For testing purposes, you may connect the printers to FILE instead of LPT1 or LPT2. If you do connect to FILE, make sure that you also substitute FILE for LPT1 or LPT2 in the following example code. For more information on installing or changing Printer settings in Windows, please see Windows' Help menu.
Step-by-Step ExampleThis example works on the following platforms:
Windows 3.1 Windows for Workgroups 3.11 Windows 95 Windows NT 3.5If you have trouble setting custom paper sizes or other printer attributes, verify that you have the latest printer driver for your specific platform, and check the printer documentation or contact the manufacturer to find out more about your printer's capabilities.
|
Additional reference words: 5.00 3.00 VFoxWin
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |