public string BuildReport(ReportViewType viewType, int templateID) { //prepare filter if (templateID != 0 && !Filter.FromDate.Equals(DateTime.MinValue)) { var interval = Filter.ToDate.DayOfYear - Filter.FromDate.DayOfYear; switch (ExtendedReportType.GetReportType()) { case ReportType.TasksByUsers: case ReportType.TasksByProjects: { Filter.FromDate = TenantUtil.DateTimeNow().Date.AddDays(-interval); Filter.ToDate = TenantUtil.DateTimeNow().Date; } break; case ReportType.MilestonesNearest: { Filter.FromDate = TenantUtil.DateTimeNow().Date; Filter.ToDate = TenantUtil.DateTimeNow().Date.AddDays(interval); } break; } } //exec var data = ExtendedReportType.BuildReport(Filter).ToList(); return(!data.Any() ? CreateNewReport(ReportType.EmptyReport, Filter).Transform(new List <object[]>(), viewType, templateID) : this.Transform(data.ToList(), viewType, templateID)); }
public IEnumerable <object[]> BuildReport() { return(ExtendedReportType.BuildReport(Filter)); }