neilkonitzer
Programmer
I've read dozens of articles regarding a "Logon Failed" message that I keep receiving, but no solution has been provided that works. Hopefully, the Tek-Tips experts will prevail!
I have developed an ASP.NET application that uses a series of Crystal Report 9 reports that I have successfully created and can open on my development machine with no problems at all.
The problem is that when I deploy the application, I keep receiving the following error:
CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.
After stepping through the code, I know that the viewer has successfully loaded the report. Somehow, it appears that the database credentials that I am passing in do not appear to be working. I have manually opened the reports on the same web server in Crystal Reports and can connect no problem. The reports will only not load when run in the context of my web application.
For further information, I am not using Windows Authentication, I am passing the SQL credentials in my ASP.NET code. Here is an example:
Dim crpt As New ReportDocument
Dim mytable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
Protected WithEvents CRViewer As CrystalDecisions.Web.CrystalReportViewer
crpt.Load("C:\inetpub\
For Each mytable In crpt.Database.Tables
myLogin = mytable.LogOnInfo
myLogin.ConnectionInfo.ServerName = "server"
myLogin.ConnectionInfo.DatabaseName = "database"
myLogin.ConnectionInfo.Password = "password"
myLogin.ConnectionInfo.UserID = "user"
mytable.ApplyLogOnInfo(myLogin)
Next
CRViewer.ReportSource = crpt
CRViewer.DataBind()
Remember, these reports have no problem opening up in the application on my development machine. It is only when deployed.
I know that there are many other developers that have had this problem. I am hoping that someone holds the key to the solution.
Thanks in advance!
Neil Konitzer
Freisoft
I have developed an ASP.NET application that uses a series of Crystal Report 9 reports that I have successfully created and can open on my development machine with no problems at all.
The problem is that when I deploy the application, I keep receiving the following error:
CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.
After stepping through the code, I know that the viewer has successfully loaded the report. Somehow, it appears that the database credentials that I am passing in do not appear to be working. I have manually opened the reports on the same web server in Crystal Reports and can connect no problem. The reports will only not load when run in the context of my web application.
For further information, I am not using Windows Authentication, I am passing the SQL credentials in my ASP.NET code. Here is an example:
Dim crpt As New ReportDocument
Dim mytable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
Protected WithEvents CRViewer As CrystalDecisions.Web.CrystalReportViewer
crpt.Load("C:\inetpub\
For Each mytable In crpt.Database.Tables
myLogin = mytable.LogOnInfo
myLogin.ConnectionInfo.ServerName = "server"
myLogin.ConnectionInfo.DatabaseName = "database"
myLogin.ConnectionInfo.Password = "password"
myLogin.ConnectionInfo.UserID = "user"
mytable.ApplyLogOnInfo(myLogin)
Next
CRViewer.ReportSource = crpt
CRViewer.DataBind()
Remember, these reports have no problem opening up in the application on my development machine. It is only when deployed.
I know that there are many other developers that have had this problem. I am hoping that someone holds the key to the solution.
Thanks in advance!
Neil Konitzer
Freisoft