dpatrickcollins
Programmer
- Nov 18, 2002
- 79
I am encountering an error using the SelectPrinter method using Crystal RDC version 9.0 Here is a snippet of my code:
Private Sub btnPrint_Click()
Dim p As Printer
For Each p In Printers
If p.DeviceName = Me.ddPrinters Then
Report.SelectPrinter p.DriverName, p.DeviceName, p.Port
Report.PrintOut True
End If
Next
End Sub
ddPrinters is a combobox which correctly evaluates to a printer on my system.
Upon executing the above code, it halts on the PRINTOUT method and states ERROR STARTING PRINT JOB. PLEASE CHECK YOUR PRINTER OR NETWORK CONNECTION.
Interestingly enough, the print window appears and shows that the correct printer is selected just before the error (the error is encountered when I press OK on the print window). Also, I have two installed printers that do not print to actual printers, one is called FAX and prints to the standard fax driver on Windows XP. The other prints to Acrobat Distiller (the print driver installed with Adobe Acrobat to generate .pdf files). These two printers do not encounter the error, but actual printers do.
Last of all, removing the SELECTPRINTER method eliminates the error. The report prints successfully to the default printer.
Any help would be GREATLY appreciated.
Private Sub btnPrint_Click()
Dim p As Printer
For Each p In Printers
If p.DeviceName = Me.ddPrinters Then
Report.SelectPrinter p.DriverName, p.DeviceName, p.Port
Report.PrintOut True
End If
Next
End Sub
ddPrinters is a combobox which correctly evaluates to a printer on my system.
Upon executing the above code, it halts on the PRINTOUT method and states ERROR STARTING PRINT JOB. PLEASE CHECK YOUR PRINTER OR NETWORK CONNECTION.
Interestingly enough, the print window appears and shows that the correct printer is selected just before the error (the error is encountered when I press OK on the print window). Also, I have two installed printers that do not print to actual printers, one is called FAX and prints to the standard fax driver on Windows XP. The other prints to Acrobat Distiller (the print driver installed with Adobe Acrobat to generate .pdf files). These two printers do not encounter the error, but actual printers do.
Last of all, removing the SELECTPRINTER method eliminates the error. The report prints successfully to the default printer.
Any help would be GREATLY appreciated.