コード例 #1
0
        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));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 private Report(ExtendedReportType reportType, TaskFilter filter)
 {
     ExtendedReportType = reportType;
     Filter             = filter;
 }
コード例 #4
0
 public IEnumerable <object[]> BuildReport()
 {
     return(ExtendedReportType.BuildReport(Filter));
 }
コード例 #5
0
 private List <object[]> GetDocbuilderData(int templateID)
 {
     PrepareFilter(templateID);
     return(ExtendedReportType.BuildDocbuilderReport(Filter).ToList());
 }
コード例 #6
0
 private Report(ExtendedReportType reportType, TaskFilter filter)
 {
     ExtendedReportType = reportType;
     Filter = filter;
 }