augiesarmy
asked on
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;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER