//9-30 public void MergeToFinalResult() { for (int i = 0; i < mTargetFileFormatList.Count; i++) { mFinalFileFormatList.Add(GetMergedData(mTargetFileFormatList[i])); } mExcel = new Excel(AppDomain.CurrentDomain.BaseDirectory + "导出结果.xls", true); string datetime = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-" + DateTime.Now.Day.ToString() + " " + DateTime.Now.Hour.ToString() + "'" + DateTime.Now.Minute.ToString() + "'" + DateTime.Now.Second.ToString(); string sheetname = "加班明细统计" + datetime; mExcel.AddWorksheet(sheetname); int curwriteline = 1; for (int i = 0; i < mFinalFileFormatList.Count; i++) { OutToExcel(mFinalFileFormatList[i], ref curwriteline, mExcel); } mExcel.ColumnAutoFit(1, 20); MessageBox.Show("Done!"); }