Click here to Skip to main content
15,885,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am working on a desktop application in C#.net and using RDLC Report.
I want to print text box values in report, but after setting parameters in rdlc and passing the values to report in report viewer, my printed report gives this error.
" the "parameter_name" parameter is missing a value ".
I have tried all ways but could not find the solution of this problem.
Kindly help me out.

What I have tried:

Code to add parameter is
ReportParameter[] parms = new ReportParameter[1];
parms[0] = new ReportParameter("[@parameter_name]", Form1.TextBox1.Text);
this.reportViewer1.LocalReport.SetParameters(parms);
this.reportViewer1.RefreshReport();
Posted
Updated 13-Dec-17 7:28am

remove the square brackets and try

C#
parms[0] = new ReportParameter("parameter_name", TextBox1.Text);
 
Share this answer
 
v2
Comments
SalmanQureshi 20-Aug-16 5:49am    
Removed, but still having the same error...
Karthik_Mahalingam 20-Aug-16 6:01am    
pass some hardcoded value to it and check
parms[0] = new ReportParameter("parameter_name","abc");
SalmanQureshi 20-Aug-16 6:17am    
Already Checked, still having the same problem
Karthik_Mahalingam 20-Aug-16 6:20am    
how you have declared the parameter in sql ?
SalmanQureshi 20-Aug-16 7:04am    
i am declaring the parameter in C# code, and passing value directly to RDLC report
C#
ReportParameterCollection reportparameter = new ReportParameterCollection();
           reportparameter.Add(new ReportParameter("productType", Globalvariables.username.ToString()));
           reportparameter.Add(new ReportParameter("customername", Globalvariables.username.ToString()));
           reportparameter.Add(new ReportParameter("customeraddress", Globalvariables.username.ToString()));
           this.ReportViewer1.LocalReport.SetParameters(reportparameter);
           this.ReportViewer1.LocalReport.Refresh();
 
Share this answer
 
Comments
Richard Deeming 13-Dec-17 14:38pm    
Asked, answered, and solved over a year ago.

And your solution simply repeats what the accepted solution says.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900