This is a migrated thread and some comments may be shown as answers.

Finding the parameters to send to a report.

2 Answers 83 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
KawaUser
Top achievements
Rank 2
KawaUser asked on 04 Nov 2010, 04:59 PM
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 Answers, 1 is accepted

Sort by
0
KawaUser
Top achievements
Rank 2
answered on 04 Nov 2010, 06:45 PM
I figured this out. No need for reply thank you.
0
des white
Top achievements
Rank 1
answered on 15 Mar 2011, 11:56 AM
Hi Kawa,

How did you resolve this.

I have the same issue?

Many Thanks, Des
Tags
General Discussions
Asked by
KawaUser
Top achievements
Rank 2
Answers by
KawaUser
Top achievements
Rank 2
des white
Top achievements
Rank 1
Share this question
or