您好,您方便发个demo上来吧,我这边模拟导出,基本2秒就好了。
- protected void Page_Load(object sender, EventArgs e)
- {
- FarPoint.Web.Spread.DoubleCellType objNumCell = new FarPoint.Web.Spread.DoubleCellType();
- objNumCell.ErrorMessage = "请输入数字型数值(数值范围:9999999999到-9999999999)";
- objNumCell.DecimalDigits = 4;
- objNumCell.MinimumValue = -9999999999;
- objNumCell.MaximumValue = 9999999999;
- objNumCell.FixedPoint = true;
- FpSpread1.ActiveSheetView.ColumnCount = 11;
- FpSpread1.ActiveSheetView.RowCount = 111111;
- for (int i = 0; i < 10000; i++)
- {
- for (int j = 0; j < 10; j++)
- {
- FpSpread1.ActiveSheetView.Cells[i, j].CellType = objNumCell;
- FpSpread1.ActiveSheetView.Cells[i, j].Value = i + j;
- }
- }
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- Response.Clear();
- Response.BufferOutput = true;
- FpSpread1.Sheets[0].Protect = false;
- FpSpread1.SaveExcel(Response.OutputStream, FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat);
- Response.ContentType = "application/octet-stream";
- string outfileName = "demo.xlsx";
- Response.AddHeader("Content-Disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode(System.Text.Encoding.UTF8.GetBytes(outfileName)));
- Response.OutputStream.Flush();
- }
复制代码 |