Hi all, I have the following code written to launch crystal and display on crystal viewer. There is a stored procedure behind the crystal report. Can someone please help. Thank You!
With crConnectionInfo
.ServerName = sServerName
.DatabaseName = sDbname
.UserID = sUserId
.Password = sPassword
End With
crTables = rptDisplayPharmacy.Database.Tables
'Pass in logon information
For Each crTable In crTables
crTableLogonInfos = crTable.LogOnInfo
crTableLogonInfos.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crTableLogonInfos)
Next
CrystalReportViewer1.ReportSource = rptDisplayPharmacy
With rptDisplayPharmacy
.SetParameterValue(0, sPass1)
.SetParameterValue(1, sPass2)
.SetParameterValue(2, sPass3)
.SetParameterValue(3, sPass4)
.SetParameterValue(4, sPass5)
'.PrintToPrinter(1, False, 0, 0)
End With
CrystalReportViewer1.ReportSource = rptDisplayPharmacy
With crConnectionInfo
.ServerName = sServerName
.DatabaseName = sDbname
.UserID = sUserId
.Password = sPassword
End With
crTables = rptDisplayPharmacy.Database.Tables
'Pass in logon information
For Each crTable In crTables
crTableLogonInfos = crTable.LogOnInfo
crTableLogonInfos.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crTableLogonInfos)
Next
CrystalReportViewer1.ReportSource = rptDisplayPharmacy
With rptDisplayPharmacy
.SetParameterValue(0, sPass1)
.SetParameterValue(1, sPass2)
.SetParameterValue(2, sPass3)
.SetParameterValue(3, sPass4)
.SetParameterValue(4, sPass5)
'.PrintToPrinter(1, False, 0, 0)
End With
CrystalReportViewer1.ReportSource = rptDisplayPharmacy