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 List <string> GetColumns(ReportViewType viewType, int templateID) { var parameters = new List <string>(); if (viewType == ReportViewType.EMail) { parameters.Add(CommonLinkUtility.GetFullAbsolutePath(string.Format("~/products/projects/reports.aspx?reportType={0}&tmplId={1}", ReportType, templateID))); parameters.Add(ReportResource.ChangeSettings); } else { parameters = viewType == ReportViewType.Csv ? ExtendedReportType.GetCsvColumnsName().ToList() : ReportInfo.Columns.ToList(); if (ReportType == ReportType.TimeSpend) { parameters.Add(Filter.PaymentStatuses.Count != 0 ? ((int)Filter.PaymentStatuses[0]).ToString(CultureInfo.InvariantCulture) : "-1"); } } return(parameters); }
private Report(ExtendedReportType reportType, TaskFilter filter) { ExtendedReportType = reportType; Filter = filter; }
public IEnumerable <object[]> BuildReport() { return(ExtendedReportType.BuildReport(Filter)); }
private List <object[]> GetDocbuilderData(int templateID) { PrepareFilter(templateID); return(ExtendedReportType.BuildDocbuilderReport(Filter).ToList()); }