none
Trouble with parameters in report RRS feed

  • Question

  • I have a test report connected to my DB with a simple SQL statement that requires two date parameters to limit the return. When I run the site and try to load the page the site stops at the line to set the parameters with and error of "An error occurred during local report processing". I opened SQL and ran the query against the DB and had no trouble getting results. below is my code.

    PAGE LOAD EVENT

     

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

     

     

    If Not Page.IsPostBack Then

     

     

     

    SetReportParameters()

     

    End If

     

    End Sub

    SETREPORTPARAMETERS SUB

     

    Private Sub SetReportParameters()

     

    Dim dtFirst As Date

     

    Dim dtSecond As Date

    dtFirst =

    "8/4/2008"

    dtSecond =

    "8/11/2008"

     

     

    Dim dt1 As Microsoft.Reporting.WebForms.ReportParameter

     

    Dim dt2 As Microsoft.Reporting.WebForms.ReportParameter

     

    dt1 =

    New Microsoft.Reporting.WebForms.ReportParameter("DATE1", dtFirst)

    dt2 =

    New Microsoft.Reporting.WebForms.ReportParameter("DATE2", dtSecond)

     

    Me.ReportViewer1.LocalReport.SetParameters(New Microsoft.Reporting.WebForms.ReportParameter() {dt1})

     

    Me.ReportViewer1.LocalReport.SetParameters(New Microsoft.Reporting.WebForms.ReportParameter() {dt2})

     

    Me.ReportViewer1.LocalReport.Refresh()

     

    End Sub

    Monday, May 4, 2009 8:55 PM

Answers