Exemplo n.º 1
0
        protected void BindReport()
        {
            //GET THE REPORT DATE
            DateTime reportDate = (DateTime)ViewState["ReportDate"];

            //UPDATE REPORT CAPTION
            ReportCaption.Visible = true;
            ReportCaption.Text    = string.Format(ReportCaption.Text, reportDate);
            //RESET THE TOTALS
            _TotalsCalculated = false;
            //GET NEW DATA
            _DailySales = ReportDataSource.GetDailySales(reportDate);
            //BIND GRID
            DailySalesGrid.DataSource = _DailySales;
            DailySalesGrid.DataBind();
        }
Exemplo n.º 2
0
        protected void ExportButton_Click(Object sender, EventArgs e)
        {
            GenericExportManager <CommerceBuilder.Reporting.OrderSummary> exportManager = GenericExportManager <CommerceBuilder.Reporting.OrderSummary> .Instance;
            GenericExportOptions <CommerceBuilder.Reporting.OrderSummary> options       = new GenericExportOptions <CommerceBuilder.Reporting.OrderSummary>();

            options.CsvFields = new string[] { "OrderNumber", "ProductTotal", "CostOfGoodTotal", "ShippingTotal", "TaxTotal", "DiscountTotal", "CouponTotal", "OtherTotal", "ProfitTotal", "GrandTotal" };

            DateTime reportDate = (DateTime)ViewState["ReportDate"];

            if (_DailySales == null)
            {
                _DailySales = ReportDataSource.GetDailySales(reportDate);
            }

            options.ExportData = _DailySales;
            options.FileTag    = string.Format("DAILY_SALES({0})", reportDate.ToShortDateString());
            exportManager.BeginExport(options);
        }