我在C#ASP.Net中創建報表,在報表中我可以過濾兩個不同日期之間創建的數據(例如開始日期:7月15日和7月17日結束日期),但是當它談到在某一天創建過濾數據(如開始日期:7月15日和結束日期:7月15日)查詢不檢索任何東西......按日期和時間過濾C#
//Code from OutletDistributor.aspx.cs
ReportManager master = ObjectFactory.GetInstance<ReportManager>();
ReportResponse responce = new ReportResponse();
if (ddDistributor == Guid.Empty)
responce = master.GetAllOutletDistributor(sDate, EDate);
else
responce = master.GetOutletDistributor(sDate, EDate, ddDistributor);
ReportViewer1.Reset();
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.ProcessingMode = ProcessingMode.Local;
var stream = Assembly.GetAssembly(typeof(SampleReport)).GetManifestResourceStream(responce.ReportResource);
ReportDataSource reportDataSource = new ReportDataSource(responce.ReportDataSet, responce.ReportDataSource);
stream = RdlcReportHelper.TranslateReport(stream);
ReportViewer1.LocalReport.DataSources.Add(reportDataSource);
ReportViewer1.LocalReport.LoadReportDefinition(stream);
ReportViewer1.LocalReport.DisplayName = ResourceHelper.GetText(null, "hq.rpt.outletdist.heading");
ReportViewer1.LocalReport.Refresh();
//Code from ReportManager.cs
//Filter All Outlet Distributor
public ReportResponse GetAllOutletDistributor(DateTime StartDate, DateTime EndDate) {
ReportResponse report = new ReportResponse();
report.ReportResource = "Distributr.HQ.Lib.Reports.RcdlFiles.OutletDistributor.rdlc";
List<OutletReportItem> Report = _outletReport.GetAllOutlets()
.Where(p => p.CreationDate >= StartDate && p.CreationDate <= EndDate).ToList();
Report.ForEach(n => report.ReportDataSource.Add(n));
report.ReportDataSet = "dsOutletDistributor";
return report;
}