please help before I kill myself over this problem...

have a report that takes 1 parameter on a report server.

Trying to call the report using the reportviewer control

All I want to do is set the report parameter in code.

Dim rp = New Microsoft.Reporting.WinForms.ReportParameter

rp.Name = "InvoiceNumber"

rp.Values.Add("0618050")

Me.ReportViewer1.ServerReport.SetParameters(rp)

Me.ReportViewer1.ShowParameterPrompts = False

ReportViewer1.RefreshReport()

This always fails. I can't figure out how to add the report parameter to the control. PLEASE save me.



Answer this question

please help before I kill myself over this problem...

  • Craig Schaepe

    here is what I get in vb.net

    Dim salesOrderNumber As ReportParameter = New ReportParameter()

    salesOrderNumber.Name = "InvoiceNumber"

    salesOrderNumber.Values.Add("0618050")

    ' Set the report parameters for the report

    dim reportparameters() as ReportViewer1.ServerReport.SetParameters(new salesOrderNumber)

    except where "new" is I get an error saying that "array bounds cannot appear in type specifiers"


  • ShivaanKeldon

    I haven't done this myself, but I did see an sample in the help files. Here's a snippet:

    // Create the sales order number report parameter
    ReportParameter salesOrderNumber = new ReportParameter();
    salesOrderNumber.Name = "SalesOrderNumber";
    salesOrderNumber.Values.Add("SO43661");

    // Set the report parameters for the report
    reportViewer1.ServerReport.SetParameters(
    new ReportParameter[] { salesOrderNumber });

    // Refresh the report
    reportViewer1.RefreshReport();

    I found this in my local reporting services help under 'Integrating Reporting Services Into Applications'-> 'Integrating Reporting Services Using the Report Viewer Control'.

    I hope this helps- please don't kill yourself over microsoft code!!!!


  • Ed Abshire

    what would this be in vb.net
  • please help before I kill myself over this problem...