try
{
this.reportViewer1.ProcessingMode= ProcessingMode.Local;
LocalReport rep = reportViewer1.LocalReport;
rep.ReportPath = "PopularHealthClub\\HistoryReport.rdlc";
string a = "Hello";
ReportParameter p1 = new ReportParameter("Textbox3", a);
this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { p1});
}
catch (Exception exc)
{
MessageBox.Show(""+exc);
}
try { this.reportViewer1.ProcessingMode= ProcessingMode.Local; LocalReport rep = reportViewer1.LocalReport; rep.ReportPath = PopularHealthClub\\HistoryReport.rdlc; string a =
Share
There is no need to create an array of
ReportParameters, just pass the one that you have created.Change this:
To this:
And by the way from what I see in your code, are you sure to have created a parameter with the name “Textbox3”? I think you are only trying to assign a value to a textbox and this is totally wrong.
Open your RDLC file, go to “View” -> “Report Data”. Now, right click on the Parameters section and select “Add New Parameter”. Use an unique name like “parameter1”. Drag this parameter in your design report.
Now that you have create your parameter, your code will look like this: