我有一个代码可以在单击 vb.net 中的按钮时加载水晶报告,但它会给出加载失败错误,请帮我解决这个问题。
我的代码是
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports System.Data
Imports System.Data.SqlClient
Public Class ClinicianListRpt
Private reportDocument As New ReportDocument()
Dim paramField As New ParameterField()
Dim paramFields As New ParameterFields()
Dim paramDiscreteValue As New ParameterDiscreteValue()
Private Sub ClinicianListRpt_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
CrystalReportViewer1.DisplayGroupTree = False
reportDocument.Load("ClinicianList.rpt")
CrystalReportViewer1.ReportSource = reportDocument
CrystalReportViewer1.ReportSource = reportDocument
reportDocument.SetDatabaseLogon("sa", "manager", "172.16.7.8", "SPEECH")
End Sub
End Class
先感谢您
吉萨