RKh
RKh

Reputation: 14161

Report is not recognizing the parameter being passed

I created a report and deployed on Reporting Services Server. This report is populated using a stored procedure which receives an input parameter: @RecordID.

In the report also, I added a variable with the name RecordID.

In my Visual Studio project, I added Report Viewer control and set the path of the server report. When I open this report on Web Page, it displays error:

Parameter 'RecordID' does not exist on this report

The code in the code-behind file is:

   protected void Page_Load(object sender, EventArgs e)
    {
        Microsoft.Reporting.WebForms.ReportParameter Param = new Microsoft.Reporting.WebForms.ReportParameter("RecordID","3");
        ReportViewer1.ShowParameterPrompts = false;
        ReportViewer1.ServerReport.SetParameters(Param);
        ReportViewer1.ServerReport.Refresh();
    }

Edited

I added a variable using Report Properties in Business Development Studio. Below is the image. This variable is set to receive value of the parameter.

enter image description here

Upvotes: 1

Views: 2793

Answers (1)

Adriano Repetti
Adriano Repetti

Reputation: 67090

In this image you see the steps to add a new parameter and to link it to the Dataset.

Upvotes: 1

Related Questions