【问题标题】:Crystal Reports "Failed to open the connection" error in ASP.NETASP.NET 中的 Crystal Reports“无法打开连接”错误
【发布时间】:2012-06-20 20:31:47
【问题描述】:

我有使用 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"

有什么建议吗?

【问题讨论】:

  • 你检查过你的连接属性吗?
  • IIS 账户是否有相应的权限?
  • 是的。一切都在 Visual Studio 中运行。我还有一些其他表,它们汇集来自同一连接的数据,即使在部署时它们也能正常工作
  • @ta.speot.is 我不知道用户应该拥有什么权限。我正在使用 NetworkService
  • 设置用户和密码进行连接

标签: c# asp.net crystal-reports


【解决方案1】:
    Dim db As New _yourdbcontext()
    Dim cr As New ReportDocument
    cr.Load(Server.MapPath("~/yourreport.rpt"))
    cr.SetDataSource(db.yourtable.ToList())
    CrystalReportViewer1.ReportSource = cr

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-26
    • 1970-01-01
    • 1970-01-01
    • 2011-07-14
    相关资源
    最近更新 更多