Esempio n. 1
0
        protected void ExportButton_Click(Object sender, EventArgs e)
        {
            DateTime fromDate = StartDate.SelectedStartDate;
            DateTime toDate   = EndDate.SelectedEndDate;
            IList <CouponSummary> couponSummaries = ReportDataSource.GetSalesByCoupon(fromDate, toDate, string.Empty, "OrderTotal DESC");

            GenericExportManager <CouponSummary> exportManager = GenericExportManager <CouponSummary> .Instance;
            GenericExportOptions <CouponSummary> options       = new GenericExportOptions <CouponSummary>();

            options.CsvFields  = new string[] { "CouponCode", "OrderCount", "OrderTotal" };
            options.ExportData = couponSummaries;
            options.FileTag    = string.Format("SALES_BY_COUPON(from:_{0}_to_{1})", fromDate.ToShortDateString(), toDate.ToShortDateString());
            exportManager.BeginExport(options);
        }