feat: 年度課程執行狀況匯出移除計畫別並新增講師及滿意度欄位

This commit is contained in:
2026-09-14 13:07:17 +08:00
parent 672a9d8a7b
commit 727cd2b0e5
3 changed files with 93 additions and 42 deletions
@@ -24,9 +24,9 @@ namespace Education.Report
excel.Sheet = sheet;
// 報表抬頭
excel.MergeCell(0, 0, 0, 10);
excel.MergeCell(0, 0, 0, 15);
excel.SetCellValue(0, 0, , titleStyleCenter);
excel.MergeCell(1, 0, 1, 10);
excel.MergeCell(1, 0, 1, 15);
if (!)
excel.SetCellValue(1, 0, String.Format("{0}年度教育訓練課程執行狀況", ), titleStyleCenter);
else
@@ -39,26 +39,36 @@ namespace Education.Report
excel.SetCellValue(2, 0, "", bodyStyleCenter);
excel.SetCellValue(2, 1, "訓練日期", bodyStyleCenter);
excel.SetCellValue(2, 2, "課程企劃編號名稱", bodyStyleCenter);
excel.SetCellValue(2, 3, "訓練計畫別", bodyStyleCenter);
excel.SetCellValue(2, 4, "訓練時數", bodyStyleCenter);
excel.SetCellValue(2, 5, "訓練場地", bodyStyleCenter);
excel.SetCellValue(2, 6, "訓練人數", bodyStyleCenter);
excel.SetCellValue(2, 7, "預估經費", bodyStyleCenter);
excel.SetCellValue(2, 8, "實際經費", bodyStyleCenter);
excel.SetCellValue(2, 9, "學員出席率", bodyStyleCenter);
excel.SetCellValue(2, 10, "整體滿意度", bodyStyleCenter);
excel.SetCellValue(2, 3, "講師姓名", bodyStyleCenter);
excel.SetCellValue(2, 4, "講師滿意度", bodyStyleCenter);
excel.SetCellValue(2, 5, "課程滿意度", bodyStyleCenter);
excel.SetCellValue(2, 6, "行政服務品質滿意度", bodyStyleCenter);
excel.SetCellValue(2, 7, "餐點與茶飲滿意度", bodyStyleCenter);
excel.SetCellValue(2, 8, "場地滿意度", bodyStyleCenter);
excel.SetCellValue(2, 9, "訓練時數", bodyStyleCenter);
excel.SetCellValue(2, 10, "訓練場地", bodyStyleCenter);
excel.SetCellValue(2, 11, "訓練人數", bodyStyleCenter);
excel.SetCellValue(2, 12, "預估經費", bodyStyleCenter);
excel.SetCellValue(2, 13, "實際經費", bodyStyleCenter);
excel.SetCellValue(2, 14, "學員出席率", bodyStyleCenter);
excel.SetCellValue(2, 15, "整體滿意度", bodyStyleCenter);
excel.SetColumnWidthInChars(0, 12);
excel.SetColumnWidthInChars(1, 12);
excel.SetColumnWidthInChars(2, 45);
excel.SetColumnWidthInChars(3, 26);
excel.SetColumnWidthInChars(4, 12);
excel.SetColumnWidthInChars(5, 30);
excel.SetColumnWidthInChars(6, 12);
excel.SetColumnWidthInChars(7, 15);
excel.SetColumnWidthInChars(3, 20);
excel.SetColumnWidthInChars(4, 15);
excel.SetColumnWidthInChars(5, 15);
excel.SetColumnWidthInChars(6, 22);
excel.SetColumnWidthInChars(7, 22);
excel.SetColumnWidthInChars(8, 15);
excel.SetColumnWidthInChars(9, 15);
excel.SetColumnWidthInChars(10, 15);
excel.SetColumnWidthInChars(9, 12);
excel.SetColumnWidthInChars(10, 30);
excel.SetColumnWidthInChars(11, 12);
excel.SetColumnWidthInChars(12, 15);
excel.SetColumnWidthInChars(13, 15);
excel.SetColumnWidthInChars(14, 15);
excel.SetColumnWidthInChars(15, 15);
excel.SetRowHeightInPoints(2, (int)Math.Truncate(BodyRowHeight * 2.0));
int rowId = 1;
@@ -69,14 +79,19 @@ namespace Education.Report
excel.SetCellValue(rowId + 2, 0, rowId, bodyStyleCenter);
excel.SetCellValue(rowId + 2, 1, .Get訓練日期Str(DAC.GetDateTime(r["訓練日期"]), DAC.GetDateTime(r["訓練日期迄"]), "yyyyMMdd"), bodyStyleCenter);
excel.SetCellValue(rowId + 2, 2, String.Format("[{0:000000}]{1}", r["編號"], r["訓練名稱"]), bodyStyleLeft);
excel.SetCellValue(rowId + 2, 3, DAC.GetString(r["訓練計畫別"]), bodyStyleLeft);
excel.SetCellValue(rowId + 2, 4, DAC.GetInt32(r["訓練時數"]), bodyStyleCenter);
excel.SetCellValue(rowId + 2, 5, DAC.GetString(r["訓練場地"]), bodyStyleCenter);
excel.SetCellValue(rowId + 2, 6, DAC.GetInt32(r["訓練人數"]), bodyStyleCenter);
excel.SetCellValue(rowId + 2, 7, DAC.GetInt32(r["預估經費"]), bodyStyleCenter);
excel.SetCellValue(rowId + 2, 8, DAC.GetInt32(r["實際經費"]), bodyStyleCenter);
excel.SetCellValue(rowId + 2, 9, DAC.GetDouble(r["學員出席率"]), bodyPercentStyle);
excel.SetCellValue(rowId + 2, 10, DAC.GetDouble(r["整體滿意度"]), bodyPercentStyle);
excel.SetCellValue(rowId + 2, 3, DAC.GetString(r["講師姓名"]), bodyStyleLeft);
excel.SetCellValue(rowId + 2, 4, DAC.GetDouble(r["講師滿意度"]), bodyPercentStyle);
excel.SetCellValue(rowId + 2, 5, DAC.GetDouble(r["課程滿意度"]), bodyPercentStyle);
excel.SetCellValue(rowId + 2, 6, DAC.GetDouble(r["行政滿意度"]), bodyPercentStyle);
excel.SetCellValue(rowId + 2, 7, DAC.GetDouble(r["餐點滿意度"]), bodyPercentStyle);
excel.SetCellValue(rowId + 2, 8, DAC.GetDouble(r["場地滿意度"]), bodyPercentStyle);
excel.SetCellValue(rowId + 2, 9, DAC.GetInt32(r["訓練時數"]), bodyStyleCenter);
excel.SetCellValue(rowId + 2, 10, DAC.GetString(r["訓練場地"]), bodyStyleCenter);
excel.SetCellValue(rowId + 2, 11, DAC.GetInt32(r["訓練人數"]), bodyStyleCenter);
excel.SetCellValue(rowId + 2, 12, DAC.GetInt32(r["預估經費"]), bodyStyleCenter);
excel.SetCellValue(rowId + 2, 13, DAC.GetInt32(r["實際經費"]), bodyStyleCenter);
excel.SetCellValue(rowId + 2, 14, DAC.GetDouble(r["學員出席率"]), bodyPercentStyle);
excel.SetCellValue(rowId + 2, 15, DAC.GetDouble(r["整體滿意度"]), bodyPercentStyle);
// excel.SetRowHeightInPoints(rowId + 2, (int)Math.Truncate(BodyRowHeight * 1.5));
rowId++;
@@ -87,13 +102,18 @@ namespace Education.Report
excel.SetCellValue(rowId + 2, 1, "", bodyStyleCenter);
excel.SetCellValue(rowId + 2, 2, "", bodyStyleLeft);
excel.SetCellValue(rowId + 2, 3, "", bodyStyleLeft);
excel.SetCellFormula(rowId + 2, 4, String.Format("SUM({0}:{1})", Excel.RCtoA1(beginRow, 4), Excel.RCtoA1(rowId + 1, 4)), bodyStyleCenter);
excel.SetCellValue(rowId + 2, 5, "", bodyStyleCenter);
excel.SetCellFormula(rowId + 2, 6, String.Format("SUM({0}:{1})", Excel.RCtoA1(beginRow, 6), Excel.RCtoA1(rowId + 1, 6)), bodyStyleCenter);
excel.SetCellFormula(rowId + 2, 7, String.Format("SUM({0}:{1})", Excel.RCtoA1(beginRow, 7), Excel.RCtoA1(rowId + 1, 7)), bodyStyleCenter);
excel.SetCellFormula(rowId + 2, 8, String.Format("SUM({0}:{1})", Excel.RCtoA1(beginRow, 8), Excel.RCtoA1(rowId + 1, 8)), bodyStyleCenter);
excel.SetCellFormula(rowId + 2, 9, String.Format("AVERAGE({0}:{1})", Excel.RCtoA1(beginRow, 9), Excel.RCtoA1(rowId + 1, 9)), bodyPercentStyle);
excel.SetCellFormula(rowId + 2, 10, String.Format("AVERAGE({0}:{1})", Excel.RCtoA1(beginRow, 10), Excel.RCtoA1(rowId + 1, 10)), bodyPercentStyle);
excel.SetCellFormula(rowId + 2, 4, String.Format("AVERAGE({0}:{1})", Excel.RCtoA1(beginRow, 4), Excel.RCtoA1(rowId + 1, 4)), bodyPercentStyle);
excel.SetCellFormula(rowId + 2, 5, String.Format("AVERAGE({0}:{1})", Excel.RCtoA1(beginRow, 5), Excel.RCtoA1(rowId + 1, 5)), bodyPercentStyle);
excel.SetCellFormula(rowId + 2, 6, String.Format("AVERAGE({0}:{1})", Excel.RCtoA1(beginRow, 6), Excel.RCtoA1(rowId + 1, 6)), bodyPercentStyle);
excel.SetCellFormula(rowId + 2, 7, String.Format("AVERAGE({0}:{1})", Excel.RCtoA1(beginRow, 7), Excel.RCtoA1(rowId + 1, 7)), bodyPercentStyle);
excel.SetCellFormula(rowId + 2, 8, String.Format("AVERAGE({0}:{1})", Excel.RCtoA1(beginRow, 8), Excel.RCtoA1(rowId + 1, 8)), bodyPercentStyle);
excel.SetCellFormula(rowId + 2, 9, String.Format("SUM({0}:{1})", Excel.RCtoA1(beginRow, 9), Excel.RCtoA1(rowId + 1, 9)), bodyStyleCenter);
excel.SetCellValue(rowId + 2, 10, "", bodyStyleCenter);
excel.SetCellFormula(rowId + 2, 11, String.Format("SUM({0}:{1})", Excel.RCtoA1(beginRow, 11), Excel.RCtoA1(rowId + 1, 11)), bodyStyleCenter);
excel.SetCellFormula(rowId + 2, 12, String.Format("SUM({0}:{1})", Excel.RCtoA1(beginRow, 12), Excel.RCtoA1(rowId + 1, 12)), bodyStyleCenter);
excel.SetCellFormula(rowId + 2, 13, String.Format("SUM({0}:{1})", Excel.RCtoA1(beginRow, 13), Excel.RCtoA1(rowId + 1, 13)), bodyStyleCenter);
excel.SetCellFormula(rowId + 2, 14, String.Format("AVERAGE({0}:{1})", Excel.RCtoA1(beginRow, 14), Excel.RCtoA1(rowId + 1, 14)), bodyPercentStyle);
excel.SetCellFormula(rowId + 2, 15, String.Format("AVERAGE({0}:{1})", Excel.RCtoA1(beginRow, 15), Excel.RCtoA1(rowId + 1, 15)), bodyPercentStyle);
excel.SetRowHeightInPoints(rowId + 2, (int)Math.Truncate(BodyRowHeight * 2.0));
MemoryStream ms = new MemoryStream();
@@ -101,4 +121,4 @@ namespace Education.Report
return ms;
}
}
}
}