Crystal Reports XI Date Range Parameter Format

I am trying to display a report on a user control with a CrystalReportViewer. It expects two parameters, a string and a DateTime range value. I have successfully got the string passed to the rpt, but I have not been able to do so for the DateTime range and get this error: Value does not fall within the expected range. The value is coming from an AJAX Calendar Extender. I have tried using a DateTime array and an ArrayList to pass in the parameter. Please advise on how to correctly pass in the DateTime range parameter. Thanks in advance for any help.

ReportDocument report = new ReportDocument();
report.SetParameterValue("pTransmitter_List", "10099");            //DateTime[] dateRange = new DateTime[2];
//dateRange[0] = (Convert.ToDateTime(txtStartDateRange.Text));            //dateRange[1] = (Convert.ToDateTime(txtEndDateRange.Text));
ArrayList dateRange = new ArrayList();            dateRange.Add(Convert.ToDateTime(txtStartDateRange.Text));            dateRange.Add(Convert.ToDateTime(txtEndDateRange.Text));            report.SetParameterValue("pDateRange", dateRange);            crvReport.ReportSource = report;

Open in new window

augiesarmyAsked:
Who is Participating?
 
mlmccConnect With a Mentor Commented:
Check this document starting on page 40.  It shows how to add a date range parameter for a subreport.
http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf

mlmcc
0
 
augiesarmyAuthor Commented:
Thanks for your help. That was just what I needed, I hadn't see the ParameterRangeValue.
0
All Courses

From novice to tech pro — start learning today.