示例#1
0
 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);
     }
 }
示例#2
0
 public bool ExportExcelTemplate(string tempFileFullPath, LAF.Common.ExcelOperation.ExcelOperationHelper.DelegateEditExcel edit)
 {
     return(new ExcelOperationHelper().WriteWorkbookTemplate(tempFileFullPath, edit));
 }