回复 21楼seasky083的帖子
抱歉,久等了。
MVC中方法如下:
- FpSpread book = new FpSpread();
-
- System.Web.UI.Page p = new System.Web.UI.Page();
- System.Web.UI.HtmlControls.HtmlForm f = new System.Web.UI.HtmlControls.HtmlForm();
- p.Controls.Add(f);
- f.Controls.Add(book);
- //this.Form.Controls.Add(book);
- book.OpenExcel(Server.MapPath("tt2.xls"), FarPoint.Excel.ExcelOpenFlags.TruncateEmptyRowsAndColumns);
- foreach (SheetView sheet in book.Sheets)
- {
- var col = sheet.NonEmptyColumnCount;
- var row = sheet.NonEmptyRowCount;
- }
- //book.Style.Add(HtmlTextWriterStyle.Display, "none"); // Make it invisible
复制代码
性能问题可以在获取后执行 book.Reset() 清除实例中的数据,提高速度。 |