public bool WriteWorkbookTemplate(string tempFileFullPath, LAF.Common.ExcelOperation.ExcelOperationHelper.DelegateEditExcel edit) { try { IWorkbook wb; using (FileStream fs = new FileStream(tempFileFullPath, FileMode.Open, FileAccess.Read)) { wb = WorkbookFactory.Create(fs); } edit(wb); using (FileStream fsm = new FileStream(tempFileFullPath, FileMode.OpenOrCreate, FileAccess.ReadWrite)) { wb.Write(fsm); fsm.Close(); } return(true); } catch (Exception ex) { return(false); } }
public bool ExportExcelTemplate(string tempFileFullPath, LAF.Common.ExcelOperation.ExcelOperationHelper.DelegateEditExcel edit) { return(new ExcelOperationHelper().WriteWorkbookTemplate(tempFileFullPath, edit)); }