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(); }
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(); }