public bool ExportExcelToReport(string pathSave, string version) { try { GetDataBackLogToExport(); } catch (Exception ex) { SystemLog.Output(SystemLog.MSG_TYPE.Err, " It's function : GetDataBackLogToExport() : Fail", ex.Message); return(false); } if (listBackLog != null && listBackLog.Count > 0) { try { Class.ToolSupport exportExcel = new Class.ToolSupport(); string strUser = Class.valiballecommon.GetStorage().UserName; return(exportExcel.ExportToTemplate(pathSave, path, listBackLog, DateTime.Now.ToString("yyyy-MM-dd"), strUser, version, DateTime.Now.ToString("yyyy"))); } catch (Exception ex) { SystemLog.Output(SystemLog.MSG_TYPE.Err, "Export excel error !", ex.Message); return(false); } } else { return(false); } }
private void Btn_ExportExcel_Click(object sender, EventArgs e) { Class.ToolSupport exportExcel = new Class.ToolSupport(); exportExcel.ExportToTemplate(path, @"C:\ERP_Temp\Temp2.xlsx", dtgv_summary); // exportExcel.dtgvExport2Excel(dtgv_summary, @"C:\ERP_Temp\Temp2.xls"); }