你好,要在保存 Excel 代码之前添加:- System.IO.MemoryStream ms = new System.IO.MemoryStream();
- //请在这里添加代码:
- FpSpread1.Sheets[0].Protect = false;
- FpSpread1.SaveExcel(ms, FarPoint.Excel.ExcelSaveFlags.SaveCustomColumnHeaders);
- Response.Clear();
- Response.ContentType = "application/VND.ms-excel";
- Response.AddHeader("Content-Disposition", "attachment;filename=PersonGZ.xls");
- FpSpread1.Sheets[0].Protect = false;
- Response.BinaryWrite(ms.ToArray());
- ms.Flush();
- ms.Close();
- Response.End();
复制代码 |