Hi,
I have been trying to publish asp.net 4.5 website with Crystal Report for VS (v. 13.0.10.1385) on Windows 2008 R2 64bit server. My development environment is...
- OS - Windows 7 64 bit
- have installed exe for Crystal Report for VS (v. 13.0.10.1385)
Reports are correctly displayed on local machine while when run from web server (windows 2008 R2 64 bit) I get the following error...
[COMException (0x8004100f): Logon failed.
Error in File dfvr2 {1047BFCF-008C-4FBB-B48E-2269F4AA40BE}.rpt:
Unable to connect: incorrect log on parameters.]
I have following references defined in my web.config...
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.ReportAppServer.DataDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
On deployment sever I have installed...
- SAP Crystal Reports runtime engine for .Net Framework (32 bit) version - 13.0.10.1385
- SAP Crystal Reports runtime engine for .Net Framework (64 bit) version - 13.0.10.1385
What is wrong with this setup?
Edit:
I have noticed that the reports which are using stored procedure have this error. The command to change database is as follows...
Private Function ChangeDBServer(repDoc As ReportDocument) As ReportDocument
Dim SubReportDocument As ReportDocument = New ReportDocument()
Dim crDatabase As Database
Dim crTables As Tables
Dim crTableLogOnInfo As TableLogOnInfo
Dim crConnectionInfo As ConnectionInfo = New ConnectionInfo()
crConnectionInfo.ServerName = ConfigurationManager.AppSettings("ServerName")
crConnectionInfo.DatabaseName = ConfigurationManager.AppSettings("DatabaseName")
crConnectionInfo.UserID = ConfigurationManager.AppSettings("DBUserID")
crConnectionInfo.Password = ConfigurationManager.AppSettings("DBPassword")
crDatabase = repDoc.Database
crTables = crDatabase.Tables
For Each tbl As Table In crTables
crTableLogOnInfo = tbl.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
tbl.ApplyLogOnInfo(crTableLogOnInfo)
tbl.Location = ConfigurationManager.AppSettings("DatabaseName") + ".dbo." + tbl.Location.Substring(tbl.Location.LastIndexOf(".") + 1)
Next
For Each obj As ReportObject In repDoc.ReportDefinition.ReportObjects
If obj.Kind = ReportObjectKind.SubreportObject Then
Dim subObj As SubreportObject = DirectCast(obj, SubreportObject)
SubReportDocument = repDoc.OpenSubreport(subObj.SubreportName)
'SubReportDocument.RecordSelectionFormula = RecordSelectionFormulae
crDatabase = SubReportDocument.Database
crTables = crDatabase.Tables
For Each tbl As Table In crTables
crTableLogOnInfo = tbl.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
tbl.ApplyLogOnInfo(crTableLogOnInfo)
tbl.Location = ConfigurationManager.AppSettings("DatabaseName") + ".dbo." + tbl.Location.Substring(tbl.Location.LastIndexOf(".") + 1)
Next
End If
Next
Return repDoc
End Function