Microsoft KB Archive/253884

= BUG: Printing to a non-default printer may cause an error =

Article ID: 253884

Article Last Modified on 2/11/2005

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q253884



SYMPTOMS
When a print request is sent to a non-default printer with the Microsoft Visual FoxPro REPORT FORM ... PROMPT command, Visual FoxPro may cause an error, generate a GPF, quit or print to the wrong printer. The text of the error message is:

Error loading printer driver



RESOLUTION
To resolve this problem you must programmatically change the FoxPro printer.

You can use code to get the name of the printer before you print, set the printer to that name and then issue the REPORT FORM command.

The following Microsoft Knowledge Base article explains how you can specify that a Visual FoxPro report be sent to a particular printer:

162798 HOWTO: Use SET PRINTER TO NAME to Specify Report Destination

In most instances, this method is acceptable. However, there may be some instances that require more control over the report options, such as number of copies, paper source, paper size, and page ranges.

If you require more control over the print report options, you may want to use the ReportFormPrompt.exe sample.

For additional information on how to download the ReportFormPrompt.exe sample, click the article number below to view the article in the Microsoft Knowledge Base:

263287 SAMPLE: ReportForm.exe Sets Print Options without REPORT FORM ... PROMPT Command



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
This problem may be reproducible with several different types of printers that are installed on a computer.

  Install the following printers to the computer:    HP4000 PCL Kyocera FS-3500 Generic Text (Set this printer as default) NOTE: The actual printer does not have to exist. You can use the Printers control panel applet to pause printing to these printers in order to suppress "printer not ready" error messages. The following combination produces the most consistent results of failure.

 Create a report named MyReport.  Enter the following code into the Visual FoxPro Command window, and then press ENTER: REPORT FORM MyReport TO PRINTER PROMPT   Print to the printers in the following order:    HP4000 PCL      OK    Kyocera FS-3500     Error loading PD    *Generic Text       OK    HP4000 PCL      Error loading PD    Kyocera FS-3500     Error loading PD NOTE: * Denotes the default printer </ol>

<div class="references_section">