这个是我加载报表的函数
Public Function LoadReport() As Integer
Dim intsuc As Integer = -2
Try
’ Dim strFielName As String = System.Environment.CurrentDirectory + "\Report\ShippingInstructions.rdlx"
Dim rptPath As New FileInfo(_nReportFileName1 )
Dim definition As New PageReport(rptPath) definition.Report.DataSources(0).ConnectionProperties.ConnectString=_nConnection1'自定义数据源连接信息
AddHandler definition.Document.LocateDataSource, AddressOf OnLocateDataSource'添加动态数据源事件,进行事件加载
ReportView.LoadDocument(definition.Document)
intsuc=1
Catch ex As Exception
MsgBox(ex.Message)
End Try
Return intsuc
End Function