Esempio n. 1
0
        protected void ExportButton_Click(Object sender, EventArgs e)
        {
            GenericExportManager <ProductBreakdownSummary> exportManager = GenericExportManager <ProductBreakdownSummary> .Instance;
            GenericExportOptions <ProductBreakdownSummary> options       = new GenericExportOptions <ProductBreakdownSummary>();

            options.CsvFields = new string[] { "Name", "Sku", "Vendor", "Quantity", "CostOfGoods", "Amount" };

            DateTime fromDate = StartDate.SelectedStartDate;
            DateTime toDate   = EndDate.SelectedEndDate;
            IList <ProductBreakdownSummary> reportData = ReportDataSource.GetProductBreakdownSummary(fromDate, toDate, AlwaysConvert.ToInt(VendorList.SelectedValue), "Amount DESC");

            options.ExportData = reportData;
            options.FileTag    = string.Format("SALES_BY_PRODUCT(from_{0}_to_{1})", fromDate.ToShortDateString(), toDate.ToShortDateString());
            exportManager.BeginExport(options);
        }