0

I found this similar thread, but it has no answer, there is only a suggestion that didn't work for me. So I decided to create a new question as there is no question like mine with an answer.

Everything is working FINE with my reportviewer. I need to create a expression on my rdlc file that receives a value as parameter.
I created a new parameter on my rdlc file named usr.
This is my code for pass the parameter, also here is where the error is firing:

ReportViewer1.LocalReport.SetParameters(new ReportParameter("usr", "Hellow"));  

Also tried this:

ReportParamter[] param = new ReportParameter[1];
param[0] = new ReportParamter("usr" "Hellow");
ReportViewer1.LocalReport.SetParamters(param);

Didn't work aswell.

I'm sure the path of my reportviewer and everything else are OK, I'm 100% sure !
the problem is with this line that I have no idea how to solve.

Community
  • 1
  • 1
Ghaleon
  • 1,186
  • 5
  • 28
  • 55

2 Answers2

0

It has got to do something with your databindings. You could check the following things:

  1. Make sure the dataset name matches. In the report, click on View->Report Data. You would see a list of Datasets. Verify that these match the ones in your databindings.
  2. If you are using Windows Forms to embed your report, make sure that your datasources are binded properly by clicking on the smarttag and click on "Choose Data Sources"
Shruti Kapoor
  • 1,106
  • 2
  • 12
  • 32
0

Try this:

List<ReportParameter> parameters = new List<ReportParameter>();

parameters.Add(new ReportParameter("usr", "Hello"));

ReportViewer1.ServerReport.SetParameters(parameters);
EmmanuelRC
  • 348
  • 1
  • 6