I have created a crystal report which renders it's data from a stored procedure. The stored proc. resides on my machine (localhost) and i have tested the connections.
However, when i try to view the report in CrystalRepoprtViewer on my ASP.Net page, i get a "Logon Failed" error. My code is:
Dim tbCurrent As Table
Dim tliCurrent As New TableLogOnInfo
Dim pvReqTyp As New ParameterValues
Dim pvReqTypPatt As New ParameterDiscreteValue
reportDocument1.Load(strReportName)
pvReqTypPatt.Value = "Scheduled"
pvReqTyp.Add(pvReqTypPatt)
reportDocument1.DataDefinition.ParameterFields("@reqTypName".ApplyCurrentValues(pvReqTyp)
'Log the report onto the Database
For Each tbCurrent In reportDocument1.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.ServerName = "localhost"
.UserID = "sa"
.Password = "sa"
.DatabaseName = "ACA_BatchSched"
End With
tbCurrent.ApplyLogOnInfo(tliCurrent)
Next tbCurrent
CrystalReportViewer1.ReportSource = reportDocument1
reportdocument1 is an instance of the reportdocument object and the stored proc contains 1 parameter.
The error is:
Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.
Any help is greatly appreciated !!!
Cheers.
However, when i try to view the report in CrystalRepoprtViewer on my ASP.Net page, i get a "Logon Failed" error. My code is:
Dim tbCurrent As Table
Dim tliCurrent As New TableLogOnInfo
Dim pvReqTyp As New ParameterValues
Dim pvReqTypPatt As New ParameterDiscreteValue
reportDocument1.Load(strReportName)
pvReqTypPatt.Value = "Scheduled"
pvReqTyp.Add(pvReqTypPatt)
reportDocument1.DataDefinition.ParameterFields("@reqTypName".ApplyCurrentValues(pvReqTyp)
'Log the report onto the Database
For Each tbCurrent In reportDocument1.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.ServerName = "localhost"
.UserID = "sa"
.Password = "sa"
.DatabaseName = "ACA_BatchSched"
End With
tbCurrent.ApplyLogOnInfo(tliCurrent)
Next tbCurrent
CrystalReportViewer1.ReportSource = reportDocument1
reportdocument1 is an instance of the reportdocument object and the stored proc contains 1 parameter.
The error is:
Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.
Any help is greatly appreciated !!!
Cheers.