remove col

This commit is contained in:
kamonwan taengsuk
2023-03-08 13:18:41 +07:00
parent ddafe4ff4f
commit d5eb8c901b
2 changed files with 72 additions and 72 deletions

View File

@@ -84,21 +84,21 @@ namespace rmutr_report.Controllers
ws.Cell("D6").Style.Font.FontSize = 16;
ws.Cell("D6").Style.Font.Bold = true;
ws.Cell("D6").Style.Alignment.WrapText = true;
ws.Cell("E5").Value = "ค่าซ่อมแซม";
ws.Cell("E5").Style.Font.FontName = "TH SarabunPSK";
ws.Cell("E5").Style.Font.FontSize = 16;
ws.Cell("E5").Style.Font.Bold = true;
ws.Cell("E5").Style.Alignment.WrapText = true;
ws.Cell("E6").Value = "บาท/ปี";
ws.Cell("E6").Style.Font.FontName = "TH SarabunPSK";
ws.Cell("E6").Style.Font.FontSize = 16;
ws.Cell("E6").Style.Font.Bold = true;
ws.Cell("E6").Style.Alignment.WrapText = true;
// ws.Cell("E5").Value = "ค่าซ่อมแซม";
// ws.Cell("E5").Style.Font.FontName = "TH SarabunPSK";
// ws.Cell("E5").Style.Font.FontSize = 16;
// ws.Cell("E5").Style.Font.Bold = true;
// ws.Cell("E5").Style.Alignment.WrapText = true;
// ws.Cell("E6").Value = "บาท/ปี";
// ws.Cell("E6").Style.Font.FontName = "TH SarabunPSK";
// ws.Cell("E6").Style.Font.FontSize = 16;
// ws.Cell("E6").Style.Font.Bold = true;
// ws.Cell("E6").Style.Alignment.WrapText = true;
ws.Range("A5:E6").Style.Fill.BackgroundColor = XLColor.Gainsboro;
ws.Range("A5:E6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range("A5:E6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Range("A5:E6").Style.Border.OutsideBorder =
ws.Range("A5:D6").Style.Fill.BackgroundColor = XLColor.Gainsboro;
ws.Range("A5:D6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range("A5:D6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Range("A5:D6").Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range("A5:A6").Style.Border.RightBorder =
XLBorderStyleValues.Thin;
@@ -113,7 +113,7 @@ namespace rmutr_report.Controllers
ws.Column(2).Width = 40;
ws.Column(3).Width = 10;
ws.Column(4).Width = 15;
ws.Column(5).Width = 15;
//ws.Column(5).Width = 15;
int row = 7;
//int row2 = 9;
@@ -128,27 +128,27 @@ namespace rmutr_report.Controllers
ws.Cell(row, 2).Value = house.type_vehicle_transport;
ws.Cell(row, 3).Value = house.quantity;
ws.Cell(row, 4).Value = house.repair_rate;
ws.Cell(row, 5).Value = house.amount;
//ws.Cell(row, 5).Value = house.amount;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Font.FontName =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontName =
"TH SarabunPSK";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Alignment.Vertical =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.Vertical =
XLAlignmentVerticalValues.Center;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Border.OutsideBorder =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Border.RightBorder =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Border.RightBorder =
XLBorderStyleValues.Thin;
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
//ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range(ws.Cell(row, 4), ws.Cell(row, 5)).SetDataType(XLDataType.Number);
ws.Range(ws.Cell(row, 4), ws.Cell(row, 5)).Style.NumberFormat.SetFormat("#,#");
ws.Cell(row, 4).SetDataType(XLDataType.Number);
ws.Cell(row, 4).Style.NumberFormat.SetFormat("#,#");
row++;
}
@@ -158,31 +158,31 @@ namespace rmutr_report.Controllers
ws.Cell(row, 2).Value = house.type_vehicle_transport;
ws.Cell(row, 3).Value = house.quantity;
ws.Cell(row, 4).Value = house.repair_rate;
ws.Cell(row, 5).Value = house.amount;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Font.FontName =
//ws.Cell(row, 5).Value = house.amount;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontName =
"TH SarabunPSK";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.WrapText = true;
ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 1).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell(row, 2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell(row, 3).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell(row, 4).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell(row, 5).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
//ws.Cell(row, 5).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
//ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Border.LeftBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 5)).Style.Border.RightBorder =
ws.Range(ws.Cell(row, 2), ws.Cell(row, 4)).Style.Border.RightBorder =
XLBorderStyleValues.Thin;
ws.Cell(row, 1).Style.Border.RightBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Border.OutsideBorder =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 4), ws.Cell(row, 5)).SetDataType(XLDataType.Number);
ws.Range(ws.Cell(row, 4), ws.Cell(row, 5)).Style.NumberFormat.SetFormat("#,#");
ws.Cell(row, 4).SetDataType(XLDataType.Number);
ws.Cell(row, 4).Style.NumberFormat.SetFormat("#,#");
row++;
}
}
@@ -269,21 +269,21 @@ namespace rmutr_report.Controllers
ws.Cell("D6").Style.Font.FontSize = 16;
ws.Cell("D6").Style.Font.Bold = true;
ws.Cell("D6").Style.Alignment.WrapText = true;
ws.Cell("E5").Value = "ค่าน้ำมันเชื้อเพลิง";
ws.Cell("E5").Style.Font.FontName = "TH SarabunPSK";
ws.Cell("E5").Style.Font.FontSize = 16;
ws.Cell("E5").Style.Font.Bold = true;
ws.Cell("E5").Style.Alignment.WrapText = true;
ws.Cell("E6").Value = "บาท/ปี";
ws.Cell("E6").Style.Font.FontName = "TH SarabunPSK";
ws.Cell("E6").Style.Font.FontSize = 16;
ws.Cell("E6").Style.Font.Bold = true;
ws.Cell("E6").Style.Alignment.WrapText = true;
// ws.Cell("E5").Value = "ค่าน้ำมันเชื้อเพลิง";
// ws.Cell("E5").Style.Font.FontName = "TH SarabunPSK";
// ws.Cell("E5").Style.Font.FontSize = 16;
// ws.Cell("E5").Style.Font.Bold = true;
// ws.Cell("E5").Style.Alignment.WrapText = true;
// ws.Cell("E6").Value = "บาท/ปี";
// ws.Cell("E6").Style.Font.FontName = "TH SarabunPSK";
// ws.Cell("E6").Style.Font.FontSize = 16;
// ws.Cell("E6").Style.Font.Bold = true;
// ws.Cell("E6").Style.Alignment.WrapText = true;
ws.Range("A5:E6").Style.Fill.BackgroundColor = XLColor.Gainsboro;
ws.Range("A5:E6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range("A5:E6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Range("A5:E6").Style.Border.OutsideBorder =
ws.Range("A5:D6").Style.Fill.BackgroundColor = XLColor.Gainsboro;
ws.Range("A5:D6").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range("A5:D6").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Range("A5:D6").Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range("A5:A6").Style.Border.RightBorder =
XLBorderStyleValues.Thin;
@@ -298,7 +298,7 @@ namespace rmutr_report.Controllers
ws.Column(2).Width = 40;
ws.Column(3).Width = 10;
ws.Column(4).Width = 25;
ws.Column(5).Width = 25;
//ws.Column(5).Width = 25;
int row = 7;
//int row2 = 9;
@@ -313,29 +313,29 @@ namespace rmutr_report.Controllers
ws.Cell(row, 2).Value = house.type_vehicle_transport;
ws.Cell(row, 3).Value = house.quantity;
ws.Cell(row, 4).Value = house.repair_rate;
ws.Cell(row, 5).Value = house.amount;
//ws.Cell(row, 5).Value = house.amount;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Font.FontName =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontName =
"TH SarabunPSK";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Alignment.Vertical =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.Vertical =
XLAlignmentVerticalValues.Center;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Border.OutsideBorder =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Border.RightBorder =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Border.RightBorder =
XLBorderStyleValues.Thin;
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Alignment.Vertical =
//ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.Vertical =
XLAlignmentVerticalValues.Center;
ws.Range(ws.Cell(row, 4), ws.Cell(row, 5)).SetDataType(XLDataType.Number);
ws.Range(ws.Cell(row, 4), ws.Cell(row, 5)).Style.NumberFormat.SetFormat("#,#");
ws.Cell(row, 4).SetDataType(XLDataType.Number);
ws.Cell(row, 4).Style.NumberFormat.SetFormat("#,#");
row++;
}
@@ -345,31 +345,31 @@ namespace rmutr_report.Controllers
ws.Cell(row, 2).Value = house.type_vehicle_transport;
ws.Cell(row, 3).Value = house.quantity;
ws.Cell(row, 4).Value = house.repair_rate;
ws.Cell(row, 5).Value = house.amount;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Font.FontName =
//ws.Cell(row, 5).Value = house.amount;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontName =
"TH SarabunPSK";
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Alignment.WrapText = true;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Font.FontSize = 16;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Alignment.WrapText = true;
ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 1).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell(row, 2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell(row, 3).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell(row, 4).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell(row, 5).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
//ws.Cell(row, 5).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
//ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Border.LeftBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 2), ws.Cell(row, 5)).Style.Border.RightBorder =
ws.Range(ws.Cell(row, 2), ws.Cell(row, 4)).Style.Border.RightBorder =
XLBorderStyleValues.Thin;
ws.Cell(row, 1).Style.Border.RightBorder =
XLBorderStyleValues.None;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 5)).Style.Border.OutsideBorder =
ws.Range(ws.Cell(row, 1), ws.Cell(row, 4)).Style.Border.OutsideBorder =
XLBorderStyleValues.Thin;
ws.Range(ws.Cell(row, 4), ws.Cell(row, 5)).SetDataType(XLDataType.Number);
ws.Range(ws.Cell(row, 4), ws.Cell(row, 5)).Style.NumberFormat.SetFormat("#,#");
ws.Cell(row, 4).SetDataType(XLDataType.Number);
ws.Cell(row, 4).Style.NumberFormat.SetFormat("#,#");
row++;
}
}

View File

@@ -18,6 +18,6 @@ namespace rmutr_report.Models
public string type_vehicle_transport { get; set; }
public decimal? quantity { get; set; }
public decimal? repair_rate { get; set; }
public decimal? amount { get; set; }
//public decimal? amount { get; set; }
}
}