我想从数据库中获取日期值并将其作为报表参数发送到报表中。但如果我现在这样做,我得到一个错误(为报告参数提供的值不适用于其类型日期时间)。我目前使用组合框来包含日期列表,并且我希望将选定的项目作为日期参数发送到报告中。我正在使用c#,并且正在使用rdlc报告文件。这是我的代码。将组合框项目作为报表日期参数发送到报表中
this.rptStockMismatch.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportServerURL"]);
this.rptStockMismatch.ShowParameterPrompts = false;
ReportParameter[] reportParameter = new ReportParameter[2];
reportParameter[0] = new ReportParameter("StockCaptureDate", this.cboStockCaptureDate.SelectedItem.ToString()); //this is where I want to insert the selected combobox itme in.
reportParameter[1] = new ReportParameter("DepotID", this.cboDepot.SelectedValue.ToString());
this.rptStockMismatch.ServerReport.SetParameters(reportParameter);
this.rptStockMismatch.RefreshReport();
尝试组合框的值转换为'datetime' –
@POHH我试过,但我仍然得到同样的错误 – Scelo