private void Button3_Click(object sender, EventArgs e) { ExportExcelTool exportExcelTool = new ExportExcelTool(); string path = @"C:\ERP_Temp\Reliability Raw_" + DateTime.Now.ToString("ddMMyy HHmmss") + ".xls"; exportExcelTool.dtgvExport2Excel(dataGridView1, path); }
public bool ExportExcelToReport(ref DataGridView gridView, string pathSave, string version) { try { GetDataBackLogToExport(); } catch (Exception ex) { Logfile.Output(StatusLog.Error, " It's function : GetDataBackLogToExport() : Fail", ex.Message); return(false); } if (listBackLog != null && listBackLog.Count > 0) { try { ExportExcelTool exportExcel = new ExportExcelTool(); string strUser = Class.valiballecommon.GetStorage().UserName; gridView.DataSource = listBackLog; return(exportExcel.ExportToTemplate(path, gridView, DateTime.Now.ToString("yyyy-MM-dd"), strUser, version, DateTime.Now.ToString("yyyy"))); } catch (Exception ex) { Logfile.Output(StatusLog.Error, "Export excel error !", ex.Message); return(false); } } else { return(false); } }
public bool ExportReportProductionFromTo(DateTime from, DateTime To) { try { DefectRateReport defectRateReport = new DefectRateReport(); List <DefectRateData> defectRateDatas = new List <DefectRateData>(); defectRateDatas = defectRateReport.GetListDefectRateReportFromTo("B01", "0010", from, To); if (defectRateDatas.Count == 0) { return(false); } SelectTopDefectItems selectTopDefect = new SelectTopDefectItems(); List <string> listHeaderRW25 = selectTopDefect.GetListStringHeaderReworkTop25(); ExportExcelTool exportExcel = new ExportExcelTool(); exportExcel.ExportToTemplateMQCDefectDaily(pathDaily, Pathsave, listHeaderRW25, defectRateDatas, from, To); return(true); } catch (Exception ex) { Logfile.Output(StatusLog.Error, "ExportReportProductionDaiLy()", ex.Message); return(false); } }
private void Button4_Click(object sender, EventArgs e) { DateTime from = dtPickerFrom.Value; DateTime to = dtPickerTo.Value; //Class.DateTimeControl.ReturnDateTimeForWeekly(ref from, ref to); //Class.DateTimeControl.ReturnDateTimeForMonthly(ref from, ref to); ExportExcelTool exportExcelTool = new ExportExcelTool(); string path = @"C:\ERP_Temp\Reliability Report_" + DateTime.Now.ToString("ddMMyy HHmmss") + ".xlsx"; string pathTemplate = Environment.CurrentDirectory + @"\Resources\Reliability.xlsx"; RealabilityReport realabilityReport = new RealabilityReport(); // realabilityReport.SendMailReliabilityReportWeekly(); List <ReliabilitySummary> ListReliability = new List <ReliabilitySummary>(); List <ReliabilitySummary> ListReliabilityDept = new List <ReliabilitySummary>(); ListReliability = realabilityReport.GetDataForReliability(from, to, out ListReliabilityDept); exportExcelTool.ExportToReliabilityReport(pathTemplate, path, ListReliability, ListReliabilityDept, from, to); }
public bool SendMailReliabilityReportMonthly() { try { DateTimeControl.ReturnDateTimeForMonthly(ref dateFrom, ref dateTo); RealabilityReport realabilityReport = new RealabilityReport(); List <ReliabilitySummary> ListReliability = new List <ReliabilitySummary>(); List <ReliabilitySummary> ListReliabilityDept = new List <ReliabilitySummary>(); ListReliability = realabilityReport.GetDataForReliability(dateFrom, dateTo, out ListReliabilityDept); ExportExcelTool exportExcelTool = new ExportExcelTool(); string path = @"C:\ERP_Temp\Reliability_Report_" + DateTime.Now.ToString("ddMMyy HHmmss") + ".xlsx"; exportExcelTool.ExportToReliabilityReport(pathTemplate, path, ListReliability, ListReliabilityDept, dateFrom, dateTo); } catch (Exception ex) { Logfile.Output(StatusLog.Error, "SendMailReliabilityReportWeekly()", ex.Message); return(false); } return(true); }