Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An attempt was made to set a report parameter 'Name' that is not defined in this report?

I am trying to load a report that filters by the name in textbox1 but I am getting the error "An attempt was made to set a report parameter 'Name' that is not defined in this report" Any ideas?

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()
like image 421
user1342164 Avatar asked Dec 14 '12 16:12

user1342164


1 Answers

The Name part of the ReportParameter must match the name of the parameter in the Report.

It's probably @Name, best this to do is to open the report and check there.

like image 131
Stuart Avatar answered Oct 23 '22 12:10

Stuart