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
REFERENCES
For additional information, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
162798 HOWTO: Use SET PRINTER TO NAME to Specify Report Destination
131201 Print Setup Options Saved with the Report
251236 HOWTO: Programmatically Set the Number of Copies for a Report