Hi,
I have developed an application using Visual Studio 2010 which two Crystal Reports (2010) that need printing directly to the printer.
One report prints to a network printer (the default printer on the client PCs)
One report prints to a USB label printer (defined in code - VB)
The problem is it is very slow. It takes around 60 seconds for both reports to print to the respective printers.
I was wondering if anyone else has had this issue and if there is any way to speed it up?
My code for the first report is as follows (the second report is very similar, except a printer name is defined):
Dim report As New ReportDocument
Dim strReportName As String
strReportName = "rptCommercialInvoice"
Dim connection As IConnectionInfo
Dim serverName As String = My.Resources.SQLServer
Dim userID As String = My.Resources.SQLServerUsername
Dim password As String = My.Resources.SQLServerPassword
report.Load(Application.StartupPath & "\Reports\" & strReportName & ".rpt")
report.SetParameterValue("@PID", intPID)
' Set Database Logon to main report
For Each connection In report.DataSourceConnections
connection.SetLogon(userID, password)
Next
report.PrintToPrinter(3, False, 0, 0)
report.Close()
Any help would be much appreciated.
Regards,
Katy