Data Access Worldwide Knowledge Base

Article ID 2296
Article Title HOWTO: Print a WinPrint2 report directly to a specific printer and without the print setup dialog pop up
Article URL http://www.dataaccess.com/kbasepublic/KBPrint.asp?ArticleID=2296
KBase Category WINPRINT
Date Created 02/16/2007
Last Edit Date 02/16/2007


Article Text
QUESTION:
I want to be able to programmatically tell a WinPrint 2 report to print to a specific printer without the user selecting it and without having the "Print Setup" dialog pop up before printing. How can I do this?

ANSWER:
To print directly without the print dialog, set the Output_Device_Mode of the cWinReport2 object to Print_To_Printer_No_Dialog.

To print to a specific printer, in Function Starting_Main_Report, before the "forward get", call DFSetDevice:

    Send DFSetDevice "Canon i350"

The device name is the printer name as listed in the "Printers and Faxes" Windows control panel.




Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2010 Data Access Corporation. All rights reserved.

The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access 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.