コード例 #1
0
        protected void IbExportDataClick(object sender, ImageClickEventArgs e)
        {
            string fileName = "出入库记录";

            fileName += WebControl.GetNowTime().ToShortDateString();
            fileName  = Server.UrlEncode(fileName);
            StockGrid.ExportSettings.ExportOnlyData = true;
            StockGrid.ExportSettings.IgnorePaging   = true;
            StockGrid.ExportSettings.FileName       = fileName;
            StockGrid.MasterTableView.ExportToExcel();
        }
コード例 #2
0
        protected void IbExportDataClick(object sender, ImageClickEventArgs e)
        {
            string fileName = Regex.Replace(RCB_SalesType.Text, @"[\s\|\-\/\<>\*\?\\]", "");

            if (EndTime == DateTime.MinValue)
            {
                fileName += "-" + WebControl.GetNowTime().ToShortDateString();
            }
            else
            {
                fileName += "-" + StartTime.ToShortDateString() + "-" + EndTime.ToShortDateString();
            }
            fileName = Server.UrlEncode(fileName);
            StockGrid.ExportSettings.ExportOnlyData = false;
            StockGrid.ExportSettings.IgnorePaging   = true;
            StockGrid.ExportSettings.FileName       = fileName;
            StockGrid.MasterTableView.ExportToExcel();
        }