6
我想加載一個報告,在textbox1中按名稱過濾,但我收到錯誤「試圖設置報告參數'名稱',但未在此報告中定義」任何想法?嘗試設置報告參數「名稱」,該報告未在此報告中定義?
Dim ds As New TestDataSetTableAdapters.tblTestDataTableAdapter
' Create report data source
Dim ID As ReportParameter
ID = New ReportParameter("Name", TextBox1.Text)
Dim rds As New ReportDataSource("MyApplication_ModelObject", ObjectDataSource1)
' Clear the datasets in the report viewer and add the new datasource
ReportViewer1.LocalReport.DataSources.Clear()
ReportViewer1.LocalReport.DataSources.Add(rds)
ReportViewer1.LocalReport.SetParameters(ID)
ReportViewer1.LocalReport.Refresh()
感謝修復了這個錯誤,但是現在當我的報告加載時,除了一條消息說沒有爲數據源'DataSet1'提供數據源實例。 – user1342164
爲這個問題開了一個新問題,可能是很多東西,但憑據相當相似。 – Stuart