I am using VS2005. how to pass the Report parameter in the reportviewer control I am using ther Remote mode for the report.
till now i know that i can set the parameter is using the bellow method. This SetParamters method only accept the parameter like Microsoft.Reporting.WinForms.ReportParameter type.
this
.reportViewer1.ServerReport.SetParameters().But can't findout how to pass that parameter in the method.
please help me.
Nilay

How to pass Report parameter in ReportViewer Control
Amaltea
Hi,
If i try to use the same code, it is showing the following error:
Value of type "ReportParameter" cannot be converted to One-dimensional array.
Any idea/solution.
Thanks in advance.
vitfrasson
http://msdn2.microsoft.com/en-us/library/microsoft.reporting.winforms.serverreport.setparameters.aspx
GordonBeMe
You can do the following:
parameters[0]
= new ReportParameter(key,new string[] {null});Lee Evans
Hi, you can do it like this:
Dim objParameter As ReportParameter
zobjParameter = New ReportParameter(strParamName, strParamValue)
Me.objReportViewer.ServerReport.SetParameters(zstrParameter)
Hope this helps!
Alejandro.
A. Jason
gmitchell7
Dim objParameter As ReportParameter
zobjParameter = New ReportParameter(strParamName, strParamValue)
Me.objReportViewer.ServerReport.SetParameters(zobjParameter)
Alejandro.
BMcK
Dhanhamsan Gunalan
Never mind. I figured it out. Just write this:
parameters(0) = New ReportParameter("X")
VB_Newbie
patmur
Thanks for reply
I have used like the following.
Microsoft.Reporting.WinForms.
ReportParameter rprameter = new Microsoft.Reporting.WinForms.ReportParameter(paraName, paraValue);this
.rvReportViewer.ServerReport.SetParameters(new Microsoft.Reporting.WinForms.ReportParameter[] {rprameter});and wroks fine. Now I need to pass null/Balnk value for the report. I have also set the property in report parameter to accept the Null and Blank value. But through codding it is not working.
Thanks
Nilna
Anver
Has anyone figured out how to pass a null value yet This code:
parameters(0) = New ReportParameter("X", New String(Nothing))
passes and empty string, not a null value.
DataWranglerAtBellSouth
I've used SSRS only but now I need to develop a report in a c# application and this is very confusing. There is a "Find" option at the top of the report viewer control, though do not know where this is coded.
How can I just add a drop-down box or something to allow the user to select from a list of values (parameters)
Sean Riddle
GChao
I ended up populating the comboBox separately and passing the selected value to the report:
private void frmRptPaintSysList_Load(object sender, EventArgs e)
{
populateComboBox();
this.paintsysTableAdapter.Fill(this.usmDataSet_paintsys.paintsys);
this.reportViewerPaintSysList.RefreshReport();
}
private void populateComboBox()
{
OleDbConnection cnn = new OleDbConnection(strCnn);
OleDbDataReader dr = null;
try
{
cboPaintSysReport.Items.Clear();
string sSQL = "SELECT DISTINCT paintsys_code FROM paintsys ORDER BY paintsys_code";
cnn.Open();
OleDbCommand cmd = new OleDbCommand(sSQL, cnn);
dr = cmd.ExecuteReader();
if (dr != null)
{
while (dr.Read())
{
cboPaintSysReport.Items.Add(dr["paintsys_code"]);
}
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (dr != null)
{
dr.Close();
}
cnn.Close();
}
}
private void cboPaintSysReport_SelectedIndexChanged(object sender, EventArgs e)
{
this.paintsysTableAdapter.FillByCode(this.usmDataSet_paintsys.paintsys, cboPaintSysReport.Text);
reportViewerPaintSysList.RefreshReport();
}