Example #1
0
        protected void btnExportXLS_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    string          fileName = string.Format("orders_{0}.xls", DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss"));
                    string          filePath = string.Format("{0}files\\ExportImport\\{1}", HttpContext.Current.Request.PhysicalApplicationPath, fileName);
                    OrderCollection orders   = GetOrders();

                    ExportManager.ExportOrdersToXLS(filePath, orders);
                    CommonHelper.WriteResponseXLS(filePath, fileName);
                }
                catch (Exception exc)
                {
                    ProcessException(exc);
                }
            }
        }