Finding the parameters to send to a report.

3 posts, 0 answers
  1. KawaUser
    KawaUser avatar
    57 posts
    Member since:
    Oct 2010

    Posted 04 Nov 2010 Link to this post

    I have created a report and it runs just fine if I manually put the parameter values in the query builder. I am using a SQL Data source that looks like this:
    SELECT     REJECT_REPORT.VENDOR, COUNT(DISTINCT REJECT_REPORT.REJECT_ID) AS QTY_RRs, RR_CATEGORY.CATEGORY, @startDate AS STARTDATE,
                          @endDate AS ENDDATE
    FROM         REJECT_REPORT LEFT OUTER JOIN
                          RR_CATEGORY ON REJECT_REPORT.CATEGORY = RR_CATEGORY.CATEGORY_ID
    WHERE     (REJECT_REPORT.OCCURENCE_DATE BETWEEN @startDate AND @endDate)
    GROUP BY REJECT_REPORT.VENDOR, RR_CATEGORY.CATEGORY, REJECT_REPORT.CATEGORY
     
    I have tried all sorts of things trying to input the parameter. Including:
    ReportViewer1.Report.ReportParameters("@endDate").Value =
    frmDateInput.dtpEnd.Value.ToShortDateString

    Dim report As New CategoryReport

            report.ReportParameters.Add("@startDate", Telerik.Reporting.ReportParameterType.DateTime, "9/1/2010")
            report.ReportParameters.Add("@endDate", Telerik.Reporting.ReportParameterType.DateTime, "9/30/2010")

            ReportViewer1.Report = report
    Dim report As New CategoryReport

            report.ReportParameters.Add("@startDate", Telerik.Reporting.ReportParameterType.DateTime, "9/1/2010")
            report.ReportParameters.Add("@endDate", Telerik.Reporting.ReportParameterType.DateTime, "9/30/2010")

            ReportViewer1.Report = report
    Dim report As New CategoryReport

            report.ReportParameters.Add("@startDate", Telerik.Reporting.ReportParameterType.DateTime, "9/1/2010")
            report.ReportParameters.Add("@endDate", Telerik.Reporting.ReportParameterType.DateTime, "9/30/2010")

            ReportViewer1.Rep

    Dim report As New CategoryReport
     
            report.ReportParameters.Add("@startDate", Telerik.Reporting.ReportParameterType.DateTime, "9/1/2010")
            report.ReportParameters.Add("@endDate", Telerik.Reporting.ReportParameterType.DateTime, "9/30/2010")
     
            ReportViewer1.Report = report

    Am I doing this right?

    I just want to send 2 date values to my report.

    Thanks,
    Charles Hawk
  2. KawaUser
    KawaUser avatar
    57 posts
    Member since:
    Oct 2010

    Posted 04 Nov 2010 Link to this post

    I figured this out. No need for reply thank you.
  3. DevCraft banner
  4. des white
    des white avatar
    14 posts
    Member since:
    Sep 2009

    Posted 15 Mar 2011 Link to this post

    Hi Kawa,

    How did you resolve this.

    I have the same issue?

    Many Thanks, Des
Back to Top