Report Viewer Parameters

Discussion in 'ASP.NET / ASP.NET Core' started by dbireporter, Jan 25, 2011.

  1. I have a ReportViewer in Server on my ASP.NET 3.5 page using VB code.
    The RV Processing Mode is Remote. I am tring to pass 2 report parameter values to the report using the following code:

    Dim P(1) As ReportParameter
    P(0) = New ReportParameter("Company_ID_Parameter", "1", True)
    P(1) = New ReportParameter("Facility_ID_Parameter", "2", True)
    My_ReportViewer.ServerReport.SetParameters(P)

    When I open the web app in Visual Studio 2005, I get the following error msg:
    "The source of the report definition has not been specified"

    Does anyone know what I am doing wrong?
     
  2. ReportViewer Parameter Error

    I try the following code in VB (ASP.NET 3.5 & SQLServer 2005):

    ReportViewer1.ServerReport.SetParameters(New ReportParameter("ID_Parameter", "1"))

    and I get the error: "Unable to cast object of type 'Microsoft.Reporting.WebForms.ReportParameter' to type 'System.Collections.Generic.IEnumerable`1[Microsoft.Reporting.WebForms.ReportParameter]'."

    Any idea what I'm doing wrong?
     
  3. Joseph Jun

    Joseph Jun DiscountASP.NET Staff

    Have you already specified values for the ReportPath and ReportServerUrl attributes for the ReportViewer Control?
     
  4. Here's what I've got:

    <rsweb:ReportViewer ID="Next_Assessment_ReportViewer" runat="server" Font-Names="Verdana"
    Font-Size="8pt" Height="400px" ShowFindControls="False" Style="border-right: #000000 thin solid;
    border-top: #000000 thin solid; left: 120px; border-left: #000000 thin solid;
    width: 800px; border-bottom: #000000 thin solid; position: absolute; top: 60px;
    height: 600px" Visible="False" Width="400px">
    <LocalReport ReportPath="Reports\Next_Assessment_Report.rdlc">
    <DataSources>
    <rsweb:ReportDataSource DataSourceId="ObjectDataSource5" Name="Next_AssessmentDataSet_Resident" />
    </DataSources>
    </LocalReport>
    </rsweb:ReportViewer>

    Thanks Joseph for your response. I've blogged this problem for weeks and tried all the suggestions, but nothing helps. I appreciate any help you can provide.
     
  5. Help With ReportViewer

    Does anyone know of a source of help with questions about using ReportViewer in ASP .NET 3.5 (VB) WebForms.
    I would like to be able to talk with someone about a specific problem I am having passing parameters to the report server. A conversation is what I need. Forums and blogs just haven't worked for me. I will pay to talk to an expert in this area.
     
  6. Joseph Jun

    Joseph Jun DiscountASP.NET Staff

    Sorry that I couldn't get back to this post sooner.

    I am glad that you were able to resolve the problem that you had. Took a few moments to check the YouTube video out as well so hopefully this post will help anyone else who also runs into the issue.
     

Share This Page