Article ID: 133163 - Last Review: February 24, 2005 - Revision: 3.4 How to control printer attributes for a report at run timeThis article was previously published under Q133163 On This PageSUMMARY
When 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 INFORMATION
Visual 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() 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 Note Visual FoxPro 5.0 and later run only under 32-bit operating systems
such as Windows 95, Windows NT 3.5 and later.
See the product documentation for your specific version of Visual FoxPro to determine the supported operating systems. Windows for Workgroups 3.11 Windows 95 Windows NT 3.5 or 3.51 Windows NT 4.0 Windows 95 Windows 98 Windows 98SE Windows 2000 Windows XP Windows 2003 Server If 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.
APPLIES TO
| Article Translations
|
Back to the top
