Crystal Reports"无法打开连接" ASP.NET中的错误

时间:2012-05-17 12:25:48

标签: c# asp.net crystal-reports

我有使用SAP Crystal Reports的ASP.NET(C#)应用程序。在Visual Studio中一切正常,但是当我将其部署到IIS时,会发生以下错误:

"Failed to open the connection. Failed to open the connection 'report name'.rpt".

我已将我的报告更改为使用系统DSN现在上一个错误消失了,但它会生成以下错误:

"Database Logon Failed"

有什么建议吗?

2 个答案:

答案 0 :(得分:0)

    Dim db As New _yourdbcontext()
    Dim cr As New ReportDocument
    cr.Load(Server.MapPath("~/yourreport.rpt"))
    cr.SetDataSource(db.yourtable.ToList())
    CrystalReportViewer1.ReportSource = cr

不要忘记在水晶报告模型连接中设置用户和密码

答案 1 :(得分:0)

如果有人在Oracle中遇到此问题,请检查此链接。希望它会帮助某人:https://stackoverflow.com/a/10764077/1380428