【问题标题】:Failed to open the connection [Crystal Report]打开连接失败【水晶报告】
【发布时间】:2013-08-03 14:28:11
【问题描述】:

我在加载使用 Crystal Report 的表单时收到此错误:

无法打开连接详细信息:[数据库供应商代码:17] 无法打开连接。 ReportMonthly {...}.rpt 详细信息: [数据库供应商代码:17]

我在 google 上研究过这个错误,所以我找到了这个 site。我尝试了那里的步骤或说明,但它不起作用意味着同样的错误。

这是我表单中的代码部分:

Private Sub FRViolators_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.ShowReport(My.Application.Info.DirectoryPath & "\ReportMonthly.rpt")

End Sub


Public Sub ShowReport(ByVal strReportPath As String)
    Dim rptDoc As CrystalDecisions.CrystalReports.Engine.ReportDocument
    rptDoc = New ReportDocument

    rptDoc.Load(strReportPath)
    CrystalReportViewer1.ReportSource = rptDoc
    CrystalReportViewer1.Refresh()
End Sub

【问题讨论】:

  • 嗨哈维。您没有在代码中提供包含连接详细信息的报告。大概您想使用报表设计中使用的连接详细信息。报告中的详细信息对运行时有效吗?
  • 连接在哪里?

标签: vb.net crystal-reports crystal-reports-2010


【解决方案1】:

创建连接手册

rptDoc.Load(strReportPath)
rptDoc.SetDatabaseLogon("user", "password", "host", "dbname");
CrystalReportViewer1.ReportSource = rptDoc
CrystalReportViewer1.Refresh()

【讨论】:

    猜你喜欢
    • 2017-06-12
    • 1970-01-01
    • 2015-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多