使用的是VR12报表,VB.NET开发,采用运行时数据绑定,在带参数时,参数带进去了,但是报表一直在运行却不显示结果,请问该怎么解决代码为:
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim rowid As String = Trim(Replace(Request.Params("id"), "'", ""))
Dim rpt As New GrapeCity.ActiveReports.PageReport
rpt.Load(New System.IO.FileInfo(Server.MapPath("") + "\\dy_jsx.rdlx"))
rpt.Report.ReportParameters(0).DefaultValue.Values.Add(rowid)
AddHandler rpt.Document.LocateDataSource, AddressOf Document_LocateDataSource
WebViewer1.PdfExportOptions.FitWindow = False
WebViewer1.PdfExportOptions.DisplayMode = GrapeCity.ActiveReports.Export.Pdf.Section.DisplayMode.Outlines
WebViewer1.Report = rpt
End Sub
Sub Document_LocateDataSource(sender As Object, args As GrapeCity.ActiveReports.LocateDataSourceEventArgs) '查询
If args.DataSourceName = "DataSource1" Then
If args.DataSetName = "DataSet1" Then
Dim rowid As String = args.Report.Parameters(0).CurrentValue.ToString()
Dim dt As New Data.DataTable
Dim sql As String
sql = "select t.*, t.rowid from tx_jsx t where t.rowid='" & rowid & "'"
dt = ds.sqldatt(sql)
Dim a = dt.Rows.Count
args.Data = dt
End If
End If
End Sub
|
|