No ReportViewer Parameter Prompt

Discussion in 'ASP.NET / ASP.NET Core' started by dbireporter, Jun 22, 2010.

  1. ReportViewer Parameter

    I have a ReportViewer on my ASP.NET 3.5 web page.

    In my VB code I set a report parameter for the report:

    Dim parameters() As ReportParameter = (Session("Resident_ID"))
    ReportViewer1.SetParameters(parameters)

    The last line of code gives me this error msg. in the design environment: "SetParameters is not a member of Microsoft.Reporting.Webforms.ReportViewer"

    Any ideas what I should do?
     
  2. ReportViewer Parameter

    I changed the code to:

    Dim p1 As New ReportParameter("Resident_ID", ToString()) 'Session("Resident_ID")))
    p1 = Session("Resident_ID")
    ReportViewer1.LocalReport.SetParameters(p1)

    Now I get a different error:

    "Unable to cast object of type 'System.String' to type 'Microsoft.Reporting.WebForms.ReportParameter'."

    Any idea what I'm doing wrong?
     
  3. ReportViewer Parameter

    I am trying a different approach using the following code:

    ReportViewer1.ShowParameterPrompts = True
    ReportViewer1.ShowPromptAreaButton = True
    ReportViewer1.ShowToolBar = True

    Yet when I run the page I don't get the prompt and I get the following error in the ReportViewer:

    "The 'Resident_ID' parameter is missing a value"

    This parameter is specified in the report .rdlc
     
  4. I have a ReportViewer tied to an .rdlc report with a parameter named Resident_ID. In the VB code of the PageLoad event I have the following code:

    ReportViewer1.ShowParameterPrompts = True
    ReportViewer1.ShowPromptAreaButton = True
    ReportViewer1.ShowToolBar = True

    Yet when I run the page I don't get the prompt and I get the following error in the ReportViewer:

    "The 'Resident_ID' parameter is missing a value"

    Any ideas what I am doing wrong?
     

Share This Page