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
DjMels
Daniel T
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
LosDude
Dim objParameter As ReportParameter
zobjParameter = New ReportParameter(strParamName, strParamValue)
Me.objReportViewer.ServerReport.SetParameters(zobjParameter)
Alejandro.
Philip King
http://msdn2.microsoft.com/en-us/library/microsoft.reporting.winforms.serverreport.setparameters.aspx
Spermij
Never mind. I figured it out. Just write this:
parameters(0) = New ReportParameter("X")
NobodySpecial
Li-Jen
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.
Syed Zishan Kalam
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)
SeamusJunior44
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();
}
Tim Sneath
whaveman
Vijay Soma
You can do the following:
parameters[0]
= new ReportParameter(key,new string[] {null});Peter Elbern
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.
Jusong
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.