Beispiel #1
0
        }         // BuildTrafficReport

        public ATag BuildMarketingChannelsSummaryReport(Report report, DateTime from, DateTime to, List <string> oColumnTypes = null)
        {
            var rpt = new MarketingChannelsSummary.MarketingChannelsSummary(DB, this);

            KeyValuePair <ReportQuery, DataTable> oData = rpt.Run(report, from, to);

            ATag oBody = new Body().Add <Class>("Body")
                         .Append(new H1().Append(new Text(report.GetTitle(from, oToDate: to))))
                         .Append(new P().Append(TableReport(oData.Key, oData.Value, oColumnTypes: oColumnTypes)));

            if (from.Date.AddDays(1) == to.Date)
            {
                for (int i = 0; i < 6; i++)
                {
                    from = from.AddDays(-1);
                    to   = to.AddDays(-1);

                    oData = rpt.Run(report, from, to);

                    oBody
                    .Append(new H1().Append(new Text(report.GetTitle(from, oToDate: to))))
                    .Append(new P().Append(TableReport(oData.Key, oData.Value, oColumnTypes: oColumnTypes)));
                }         // for
            }             // if

            return(oBody);
        }         // BuildMarketingChannelsSummaryReport
Beispiel #2
0
        }         // BuildTrafficReportXls

        public ExcelPackage BuildMarketingChannelsSummaryXls(Report report, DateTime from, DateTime to)
        {
            var rpt = new MarketingChannelsSummary.MarketingChannelsSummary(DB, this);
            KeyValuePair <ReportQuery, DataTable> oData = rpt.Run(report, from, to);

            ExcelPackage wb = AddSheetToExcel(oData.Value, report.GetTitle(from, oToDate: to), report.Title);

            if (from.Date.AddDays(1) == to.Date)
            {
                for (int i = 1; i < 7; i++)
                {
                    from = from.AddDays(-1);
                    to   = to.AddDays(-1);

                    oData = rpt.Run(report, from, to);

                    wb = AddSheetToExcel(oData.Value, report.GetTitle(from, oToDate: to), i + " day" + (i == 1 ? "" : "s") + " before", report.Title, wb: wb);
                }         // for
            }             // if

            return(wb);
        }         // BuildMarketingChannelsSummarXls