This commit is contained in:
kamonwan taengsuk
2023-02-19 13:55:22 +07:00
parent c9d548b642
commit f8e4248d7f
2 changed files with 154 additions and 33 deletions

View File

@@ -137,6 +137,7 @@ namespace rmutr_report.Controllers
ws.Column(21).Width = 10;
ws.Column(22).Width = 10;
ws.Column(23).Width = 10;
ws.Columns().AdjustToContents();
ws.Column(1).Style.Font.FontName = "TH Sarabun New";
ws.Column(1).Style.Font.FontSize = 16;
ws.Column(2).Style.Font.FontName = "TH Sarabun New";
@@ -599,7 +600,7 @@ namespace rmutr_report.Controllers
ws.Cell(row, 1).SetValue(kpiname).Style.Font.Bold = true;
ws.Cell(row, 1).Style.Border.OutsideBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 15)).Merge().Style.Fill.BackgroundColor =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
if (a==10)
@@ -610,7 +611,7 @@ namespace rmutr_report.Controllers
ws.Cell(row, 1).SetValue(kpiname).Style.Font.Bold = true;
ws.Cell(row, 1).Style.Border.OutsideBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Merge().Style.Fill.BackgroundColor =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 17)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
if (a==11)
@@ -621,7 +622,7 @@ namespace rmutr_report.Controllers
ws.Cell(row, 1).SetValue(kpiname).Style.Font.Bold = true;
ws.Cell(row, 1).Style.Border.OutsideBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 17)).Merge().Style.Fill.BackgroundColor =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 18)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
if (a==12)
@@ -632,7 +633,7 @@ namespace rmutr_report.Controllers
ws.Cell(row, 1).SetValue(kpiname).Style.Font.Bold = true;
ws.Cell(row, 1).Style.Border.OutsideBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 18)).Merge().Style.Fill.BackgroundColor =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
if (a==13)
@@ -643,7 +644,7 @@ namespace rmutr_report.Controllers
ws.Cell(row, 1).SetValue(kpiname).Style.Font.Bold = true;
ws.Cell(row, 1).Style.Border.OutsideBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Merge().Style.Fill.BackgroundColor =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 20)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
if (a==14)
@@ -654,7 +655,7 @@ namespace rmutr_report.Controllers
ws.Cell(row, 1).SetValue(kpiname).Style.Font.Bold = true;
ws.Cell(row, 1).Style.Border.OutsideBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 20)).Merge().Style.Fill.BackgroundColor =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
if (a==15)
@@ -664,7 +665,7 @@ namespace rmutr_report.Controllers
ws.Cell(row, 1).SetValue(kpiname).Style.Font.Bold = true;
ws.Cell(row, 1).Style.Border.OutsideBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 21)).Merge().Style.Fill.BackgroundColor =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 22)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
if (a==16)
@@ -675,7 +676,7 @@ namespace rmutr_report.Controllers
ws.Cell(row, 1).SetValue(kpiname).Style.Font.Bold = true;
ws.Cell(row, 1).Style.Border.OutsideBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 22)).Merge().Style.Fill.BackgroundColor =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 23)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
if (a==17)
@@ -686,7 +687,7 @@ namespace rmutr_report.Controllers
ws.Cell(row, 1).SetValue(kpiname).Style.Font.Bold = true;
ws.Cell(row, 1).Style.Border.OutsideBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 23)).Merge().Style.Fill.BackgroundColor =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 24)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
if (a==18)
@@ -697,7 +698,7 @@ namespace rmutr_report.Controllers
ws.Cell(row, 1).SetValue(kpiname).Style.Font.Bold = true;
ws.Cell(row, 1).Style.Border.OutsideBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 24)).Merge().Style.Fill.BackgroundColor =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 25)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
if (a==19)
@@ -708,7 +709,7 @@ namespace rmutr_report.Controllers
ws.Cell(row, 1).SetValue(kpiname).Style.Font.Bold = true;
ws.Cell(row, 1).Style.Border.OutsideBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 25)).Merge().Style.Fill.BackgroundColor =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 26)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
if (a==20)
@@ -719,12 +720,12 @@ namespace rmutr_report.Controllers
ws.Cell(row, 1).SetValue(kpiname).Style.Font.Bold = true;
ws.Cell(row, 1).Style.Border.OutsideBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 26)).Merge().Style.Fill.BackgroundColor =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 27)).Merge().Style.Fill.BackgroundColor =
XLColor.Bisque;
}
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 1).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell(row,26).Style.Border.RightBorder = XLBorderStyleValues.Thin;
//ws.Cell(row,27).Style.Border.RightBorder = XLBorderStyleValues.Thin;
row++;
foreach (var data1 in header.data)
{
@@ -746,10 +747,10 @@ namespace rmutr_report.Controllers
ws.Cell(row,col2).Style.Font.FontSize = 16;
col2++;
}
ws.Range(ws.Cell(row, 1),ws.Cell(row,26)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range(ws.Cell(row, 1),ws.Cell(row,26)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Range(ws.Cell(row,8),ws.Cell(row,26)).Style.Alignment.SetTextRotation(90);
ws.Range(ws.Cell(row,8),ws.Cell(row,26)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1),ws.Cell(row,27)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range(ws.Cell(row, 1),ws.Cell(row,27)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Range(ws.Cell(row,8),ws.Cell(row,27)).Style.Alignment.SetTextRotation(90);
ws.Range(ws.Cell(row,8),ws.Cell(row,27)).Style.Alignment.WrapText = true;
ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
ws.Cell(row, 1).Style.Border.LeftBorder = XLBorderStyleValues.Thin;
@@ -776,10 +777,10 @@ namespace rmutr_report.Controllers
// ws.Cell(row, 21).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Cell(row, 22).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
// ws.Cell(row, 23).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1),ws.Cell(row,26)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1),ws.Cell(row,27)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1),ws.Cell(row,26)).Style.Font.FontName = "TH Sarabun New";
ws.Range(ws.Cell(row, 1),ws.Cell(row,26)).Style.Font.FontSize = 16;
ws.Range(ws.Cell(row, 1),ws.Cell(row,27)).Style.Font.FontName = "TH Sarabun New";
ws.Range(ws.Cell(row, 1),ws.Cell(row,27)).Style.Font.FontSize = 16;
row++;
rowno++;
col++;