none
Trouble passing objdatasource paramters to a RRS feed

  • Question

  • hi all  - having a problem passing a parameter. Trying to produce a local report on a web page. Works perfectly with static data. when I introduce a parameter derived from a dropdown list, paramater appears set ok but what is actually passed in is  is the zero index selected value of  the dropdownlist instead of the  nominated value.  Have tried to find what is happening, checked teh RDLC XML file, etc and no joy. Here is the code.for creating the report. In pageload ( of course when not a postback) the dropdown is populated and hence the index auto set to 0.

    Regards


    Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged

            Dim customer As String = DropDownList1.SelectedValue
            Dim k As Microsoft.Reporting.WebForms.ReportViewer
            Dim r As New ReportControl.Class1 '/// A class that returns a  reportviewer
            k = r.GerReportViewer
            k.ID = "ReportViewer2"
            Dim ui As New System.Web.UI.WebControls.Unit(600, UnitType.Pixel)
            k.Height = ui

            ui = New System.Web.UI.WebControls.Unit(1200, UnitType.Pixel)
            k.Width = ui
      
            k.LocalReport.ReportPath = "Forms Franchisor Cash/Report.rdlc"
      
            Dim Obj = New ObjectDataSource("FranchisorOutstandingsWrapper", "GetFranchisorCustomerOustandings")

            Dim p As New System.Web.UI.WebControls.Parameter("customerid", TypeCode.String, customer)

            p.Direction = Data.ParameterDirection.Input

            Obj.SelectParameters.Add(p)

            k.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("ds_Outstandings_DataTable1", Obj))

            Panel1.Controls.Add(k)

        End Sub
    Friday, April 13, 2007 12:11 PM