bug fixed
This commit is contained in:
@@ -158,240 +158,240 @@ namespace rmutr_report.Controllers
|
||||
|
||||
return Ok();
|
||||
}
|
||||
[HttpPost, Route("reports/materials_construction_labor/{type}")]
|
||||
[ApiExplorerSettings(GroupName = "reports")]
|
||||
public IActionResult GetConstructionReport([FromRoute] string type,
|
||||
[FromBody] building_four building_fours) {
|
||||
{
|
||||
var workbook = new XLWorkbook();
|
||||
var ws = workbook.Worksheets.Add("Page1");
|
||||
ws.Range("A1:J1").Merge().Value = "13. บัญชีแสดงปริมาณวัสดุและแรงงานค่าก่อสร้าง";
|
||||
ws.Range("A1:J1").Style.Alignment.WrapText = true;
|
||||
ws.Range("A1:J1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||
ws.Range("A1:J1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Cell("A1").Style.Font.FontName = "TH SarabunPSK";
|
||||
ws.Cell("A1").Style.Font.FontSize = 16;
|
||||
ws.Range("A1:D1").Style.Font.Bold = true;
|
||||
ws.Range("A2:A3").Merge().Value = "ลำดับที่";
|
||||
ws.Range("A2:A3").Style.Border.OutsideBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Range("A2:A3").Style.Alignment.WrapText = true;
|
||||
ws.Range("A2:A3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Range("A2:A3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Cell("A2").Style.Font.FontName = "TH SarabunPSK";
|
||||
ws.Cell("A2").Style.Font.FontSize = 14;
|
||||
ws.Range("A2:D2").Style.Font.Bold = true;
|
||||
ws.Range("B2:B3").Merge().Value = "กิจกรรมการดำเนินงาน";
|
||||
ws.Range("B2:B3").Style.Border.OutsideBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Cell("B2").Style.Font.FontName = "TH SarabunPSK";
|
||||
ws.Cell("B2").Style.Font.FontSize = 14;
|
||||
ws.Cell("B2").Style.Font.Bold = true;
|
||||
ws.Cell("B2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell("B2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Range("C2:C3").Merge().Value = "ปริมาณ";
|
||||
ws.Cell("C2").Style.Font.FontName = "TH SarabunPSK";
|
||||
ws.Cell("C2").Style.Font.FontSize = 14;
|
||||
ws.Cell("C2").Style.Font.Bold = true;
|
||||
ws.Cell("C2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell("C2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Range("D2:D3").Merge().Value = "หน่วย";
|
||||
ws.Range("D2:D3").Style.Border.OutsideBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Cell("D2").Style.Font.FontName = "TH SarabunPSK";
|
||||
ws.Cell("D2").Style.Font.FontSize = 14;
|
||||
ws.Cell("D2").Style.Font.Bold = true;
|
||||
ws.Cell("D2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell("D2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Range("E2:F2").Merge().Value = "ค่าวัสดุ";
|
||||
ws.Range("E2:F2").Style.Border.OutsideBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Cell("E2").Style.Font.FontName = "TH SarabunPSK";
|
||||
ws.Cell("E2").Style.Font.FontSize = 14;
|
||||
ws.Cell("E2").Style.Font.Bold = true;
|
||||
ws.Cell("E2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell("E2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Cell("E3").Value = "หน่วยละ";
|
||||
ws.Cell("E3").Style.Font.FontName = "TH SarabunPSK";
|
||||
ws.Cell("E3").Style.Font.FontSize = 14;
|
||||
ws.Cell("E3").Style.Font.Bold = true;
|
||||
ws.Cell("E3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell("E3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Cell("E3").Style.Border.RightBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Cell("F3").Value = "รวมเงิน";
|
||||
ws.Cell("F3").Style.Font.FontName = "TH SarabunPSK";
|
||||
ws.Cell("F3").Style.Font.FontSize = 14;
|
||||
ws.Cell("F3").Style.Font.Bold = true;
|
||||
ws.Cell("F3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell("F3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Cell("F3").Style.Border.RightBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Range("G2:H2").Merge().Value = "ค่าแรงงาน";
|
||||
ws.Range("G2:H2").Style.Border.OutsideBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Cell("G2").Style.Font.FontName = "TH SarabunPSK";
|
||||
ws.Cell("G2").Style.Font.FontSize = 14;
|
||||
ws.Cell("G2").Style.Font.Bold = true;
|
||||
ws.Cell("G2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell("G2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Cell("G3").Value = "หน่วยละ";
|
||||
ws.Cell("G3").Style.Font.FontName = "TH SarabunPSK";
|
||||
ws.Cell("G3").Style.Font.FontSize = 14;
|
||||
ws.Cell("G3").Style.Font.Bold = true;
|
||||
ws.Cell("G3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell("G3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Cell("G3").Style.Border.RightBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Cell("H3").Value = "รวมเงิน";
|
||||
ws.Cell("H3").Style.Font.FontName = "TH SarabunPSK";
|
||||
ws.Cell("H3").Style.Font.FontSize = 14;
|
||||
ws.Cell("H3").Style.Font.Bold = true;
|
||||
ws.Cell("H3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell("H3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Cell("H3").Style.Border.RightBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Range("I2:I3").Merge().Value = "ราคารวม";
|
||||
ws.Cell("I2").Style.Font.FontName = "TH SarabunPSK";
|
||||
ws.Cell("I2").Style.Font.FontSize = 14;
|
||||
ws.Cell("I2").Style.Font.Bold = true;
|
||||
ws.Cell("I2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell("I2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Range("J2:J3").Merge().Value = "หมายเหตุ";
|
||||
ws.Range("J2:J3").Style.Border.OutsideBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Cell("J2").Style.Font.FontName = "TH SarabunPSK";
|
||||
ws.Cell("J2").Style.Font.FontSize = 14;
|
||||
ws.Cell("J2").Style.Font.Bold = true;
|
||||
ws.Cell("J2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell("J2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
ws.Range("A2:J3").Style.Border.OutsideBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Row(1).Height = 20;
|
||||
ws.Column(1).Width = 10;
|
||||
ws.Column(2).Width = 30;
|
||||
ws.Column(3).Width = 10;
|
||||
ws.Column(4).Width = 10;
|
||||
ws.Column(5).Width = 10;
|
||||
ws.Column(6).Width = 10;
|
||||
ws.Column(7).Width = 10;
|
||||
ws.Column(8).Width = 10;
|
||||
ws.Column(9).Width = 10;
|
||||
ws.Column(10).Width = 30;
|
||||
int row = 4;
|
||||
int no = 1;
|
||||
ws.Range(ws.Cell(row, 5), ws.Cell(row, 9)).SetDataType(XLDataType.Number);
|
||||
if (building_fours.material_construction_labor != null)
|
||||
{
|
||||
var sumall = building_fours.material_construction_labor.Where(d => d.total_amount == d.total_amount)
|
||||
.Sum(o => o.total_amount);
|
||||
foreach (var fours in building_fours.material_construction_labor)
|
||||
{
|
||||
|
||||
if (fours.operational_activities != "รวมทั้งสิ้น")
|
||||
{
|
||||
|
||||
ws.Cell(row, 1).Value = no;
|
||||
no++;
|
||||
ws.Cell(row, 2).Value = fours.operational_activities;
|
||||
ws.Cell(row, 3).Value = fours.amount;
|
||||
ws.Cell(row, 4).Value = fours.unit;
|
||||
ws.Cell(row, 5).Value = fours.material_cost;
|
||||
ws.Cell(row, 6).Value = fours.material_cost;
|
||||
ws.Cell(row, 7).Value = fours.labor_unit;
|
||||
ws.Cell(row, 8).Value = fours.labor_cost;
|
||||
ws.Cell(row, 9).Value = fours.total_amount;
|
||||
ws.Cell(row, 10).Value = fours.note;
|
||||
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName =
|
||||
"TH SarabunPSK";
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 14;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.WrapText = true;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.Vertical =
|
||||
XLAlignmentVerticalValues.Center;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.OutsideBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).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, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||
//ws.Range(ws.Cell(5, 1), ws.Cell(5, 4)).Style.Font.Bold = true;
|
||||
//ws.Range(ws.Cell(6, 1), ws.Cell(6, 4)).Style.Border.BottomBorder = XLBorderStyleValues.Double;
|
||||
//ws.Range(ws.Cell(6, 1), ws.Cell(6, 4)).Style.Font.Bold = true;
|
||||
//ws.Cell(row, 3).Style.NumberFormat.NumberFormatId = 2;
|
||||
//ws.Cell(row, 3).DataType = XLDataType.Number;
|
||||
//ws.Cell(row,3).SetDataType(XLDataType.Number);
|
||||
ws.Range(ws.Cell(row, 5), ws.Cell(row, 9)).Style.NumberFormat.SetFormat("#,#");
|
||||
|
||||
row++;
|
||||
}
|
||||
if (fours.operational_activities == "รวมทั้งสิ้น")
|
||||
{
|
||||
|
||||
ws.Cell(row, 1).Value = null;
|
||||
ws.Cell(row, 2).Value = fours.operational_activities;
|
||||
ws.Cell(row, 3).Value = null;
|
||||
ws.Cell(row, 4).Value = null;
|
||||
ws.Cell(row, 5).Value = null;
|
||||
ws.Cell(row, 6).Value = null;
|
||||
ws.Cell(row, 7).Value = null;
|
||||
ws.Cell(row, 8).Value = null;
|
||||
ws.Cell(row, 9).Value = sumall;
|
||||
ws.Cell(row, 10).Value = null;
|
||||
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName =
|
||||
"TH SarabunPSK";
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 14;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.WrapText = true;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.Vertical =
|
||||
XLAlignmentVerticalValues.Center;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.OutsideBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.RightBorder =
|
||||
XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 2).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, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||
ws.Cell(row, 2).Style.Font.Bold = true;
|
||||
ws.Cell(row, 9).Style.Font.Bold = true;
|
||||
//ws.Range(ws.Cell(6, 1), ws.Cell(6, 4)).Style.Border.BottomBorder = XLBorderStyleValues.Double;
|
||||
//ws.Range(ws.Cell(6, 1), ws.Cell(6, 4)).Style.Font.Bold = true;
|
||||
//ws.Cell(row, 3).Style.NumberFormat.NumberFormatId = 2;
|
||||
//ws.Cell(row, 3).DataType = XLDataType.Number;
|
||||
//ws.Cell(row,3).SetDataType(XLDataType.Number);
|
||||
ws.Range(ws.Cell(row, 5), ws.Cell(row, 9)).Style.NumberFormat.SetFormat("#,#");
|
||||
|
||||
row++;
|
||||
}
|
||||
}
|
||||
}
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
workbook.SaveAs(stream);
|
||||
var content = stream.ToArray();
|
||||
string date = DateTime.Now.ToString("yyyyMMddHHmmss");
|
||||
return File(
|
||||
content,
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
"materials_construction_" + date + ".xlsx");
|
||||
}
|
||||
}
|
||||
}
|
||||
// [HttpPost, Route("reports/materials_construction_labor/{type}")]
|
||||
// [ApiExplorerSettings(GroupName = "reports")]
|
||||
// public IActionResult GetConstructionReport([FromRoute] string type,
|
||||
// [FromBody] building_four building_fours) {
|
||||
// {
|
||||
// var workbook = new XLWorkbook();
|
||||
// var ws = workbook.Worksheets.Add("Page1");
|
||||
// ws.Range("A1:J1").Merge().Value = "13. บัญชีแสดงปริมาณวัสดุและแรงงานค่าก่อสร้าง";
|
||||
// ws.Range("A1:J1").Style.Alignment.WrapText = true;
|
||||
// ws.Range("A1:J1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||
// ws.Range("A1:J1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
// ws.Cell("A1").Style.Font.FontName = "TH SarabunPSK";
|
||||
// ws.Cell("A1").Style.Font.FontSize = 16;
|
||||
// ws.Range("A1:D1").Style.Font.Bold = true;
|
||||
// ws.Range("A2:A3").Merge().Value = "ลำดับที่";
|
||||
// ws.Range("A2:A3").Style.Border.OutsideBorder =
|
||||
// XLBorderStyleValues.Thin;
|
||||
// ws.Range("A2:A3").Style.Alignment.WrapText = true;
|
||||
// ws.Range("A2:A3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Range("A2:A3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
// ws.Cell("A2").Style.Font.FontName = "TH SarabunPSK";
|
||||
// ws.Cell("A2").Style.Font.FontSize = 14;
|
||||
// ws.Range("A2:D2").Style.Font.Bold = true;
|
||||
// ws.Range("B2:B3").Merge().Value = "กิจกรรมการดำเนินงาน";
|
||||
// ws.Range("B2:B3").Style.Border.OutsideBorder =
|
||||
// XLBorderStyleValues.Thin;
|
||||
// ws.Cell("B2").Style.Font.FontName = "TH SarabunPSK";
|
||||
// ws.Cell("B2").Style.Font.FontSize = 14;
|
||||
// ws.Cell("B2").Style.Font.Bold = true;
|
||||
// ws.Cell("B2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell("B2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
// ws.Range("C2:C3").Merge().Value = "ปริมาณ";
|
||||
// ws.Cell("C2").Style.Font.FontName = "TH SarabunPSK";
|
||||
// ws.Cell("C2").Style.Font.FontSize = 14;
|
||||
// ws.Cell("C2").Style.Font.Bold = true;
|
||||
// ws.Cell("C2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell("C2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
// ws.Range("D2:D3").Merge().Value = "หน่วย";
|
||||
// ws.Range("D2:D3").Style.Border.OutsideBorder =
|
||||
// XLBorderStyleValues.Thin;
|
||||
// ws.Cell("D2").Style.Font.FontName = "TH SarabunPSK";
|
||||
// ws.Cell("D2").Style.Font.FontSize = 14;
|
||||
// ws.Cell("D2").Style.Font.Bold = true;
|
||||
// ws.Cell("D2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell("D2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
// ws.Range("E2:F2").Merge().Value = "ค่าวัสดุ";
|
||||
// ws.Range("E2:F2").Style.Border.OutsideBorder =
|
||||
// XLBorderStyleValues.Thin;
|
||||
// ws.Cell("E2").Style.Font.FontName = "TH SarabunPSK";
|
||||
// ws.Cell("E2").Style.Font.FontSize = 14;
|
||||
// ws.Cell("E2").Style.Font.Bold = true;
|
||||
// ws.Cell("E2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell("E2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
// ws.Cell("E3").Value = "หน่วยละ";
|
||||
// ws.Cell("E3").Style.Font.FontName = "TH SarabunPSK";
|
||||
// ws.Cell("E3").Style.Font.FontSize = 14;
|
||||
// ws.Cell("E3").Style.Font.Bold = true;
|
||||
// ws.Cell("E3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell("E3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
// ws.Cell("E3").Style.Border.RightBorder =
|
||||
// XLBorderStyleValues.Thin;
|
||||
// ws.Cell("F3").Value = "รวมเงิน";
|
||||
// ws.Cell("F3").Style.Font.FontName = "TH SarabunPSK";
|
||||
// ws.Cell("F3").Style.Font.FontSize = 14;
|
||||
// ws.Cell("F3").Style.Font.Bold = true;
|
||||
// ws.Cell("F3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell("F3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
// ws.Cell("F3").Style.Border.RightBorder =
|
||||
// XLBorderStyleValues.Thin;
|
||||
// ws.Range("G2:H2").Merge().Value = "ค่าแรงงาน";
|
||||
// ws.Range("G2:H2").Style.Border.OutsideBorder =
|
||||
// XLBorderStyleValues.Thin;
|
||||
// ws.Cell("G2").Style.Font.FontName = "TH SarabunPSK";
|
||||
// ws.Cell("G2").Style.Font.FontSize = 14;
|
||||
// ws.Cell("G2").Style.Font.Bold = true;
|
||||
// ws.Cell("G2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell("G2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
// ws.Cell("G3").Value = "หน่วยละ";
|
||||
// ws.Cell("G3").Style.Font.FontName = "TH SarabunPSK";
|
||||
// ws.Cell("G3").Style.Font.FontSize = 14;
|
||||
// ws.Cell("G3").Style.Font.Bold = true;
|
||||
// ws.Cell("G3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell("G3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
// ws.Cell("G3").Style.Border.RightBorder =
|
||||
// XLBorderStyleValues.Thin;
|
||||
// ws.Cell("H3").Value = "รวมเงิน";
|
||||
// ws.Cell("H3").Style.Font.FontName = "TH SarabunPSK";
|
||||
// ws.Cell("H3").Style.Font.FontSize = 14;
|
||||
// ws.Cell("H3").Style.Font.Bold = true;
|
||||
// ws.Cell("H3").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell("H3").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
// ws.Cell("H3").Style.Border.RightBorder =
|
||||
// XLBorderStyleValues.Thin;
|
||||
// ws.Range("I2:I3").Merge().Value = "ราคารวม";
|
||||
// ws.Cell("I2").Style.Font.FontName = "TH SarabunPSK";
|
||||
// ws.Cell("I2").Style.Font.FontSize = 14;
|
||||
// ws.Cell("I2").Style.Font.Bold = true;
|
||||
// ws.Cell("I2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell("I2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
// ws.Range("J2:J3").Merge().Value = "หมายเหตุ";
|
||||
// ws.Range("J2:J3").Style.Border.OutsideBorder =
|
||||
// XLBorderStyleValues.Thin;
|
||||
// ws.Cell("J2").Style.Font.FontName = "TH SarabunPSK";
|
||||
// ws.Cell("J2").Style.Font.FontSize = 14;
|
||||
// ws.Cell("J2").Style.Font.Bold = true;
|
||||
// ws.Cell("J2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell("J2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
|
||||
// ws.Range("A2:J3").Style.Border.OutsideBorder =
|
||||
// XLBorderStyleValues.Thin;
|
||||
// ws.Row(1).Height = 20;
|
||||
// ws.Column(1).Width = 10;
|
||||
// ws.Column(2).Width = 30;
|
||||
// ws.Column(3).Width = 10;
|
||||
// ws.Column(4).Width = 10;
|
||||
// ws.Column(5).Width = 10;
|
||||
// ws.Column(6).Width = 10;
|
||||
// ws.Column(7).Width = 10;
|
||||
// ws.Column(8).Width = 10;
|
||||
// ws.Column(9).Width = 10;
|
||||
// ws.Column(10).Width = 30;
|
||||
// int row = 4;
|
||||
// int no = 1;
|
||||
// ws.Range(ws.Cell(row, 5), ws.Cell(row, 9)).SetDataType(XLDataType.Number);
|
||||
// if (building_fours.material_construction_labor != null)
|
||||
// {
|
||||
// var sumall = building_fours.material_construction_labor.Where(d => d.total_amount == d.total_amount)
|
||||
// .Sum(o => o.total_amount);
|
||||
// foreach (var fours in building_fours.material_construction_labor)
|
||||
// {
|
||||
//
|
||||
// if (fours.operational_activities != "รวมทั้งสิ้น")
|
||||
// {
|
||||
//
|
||||
// ws.Cell(row, 1).Value = no;
|
||||
// no++;
|
||||
// ws.Cell(row, 2).Value = fours.operational_activities;
|
||||
// ws.Cell(row, 3).Value = fours.amount;
|
||||
// ws.Cell(row, 4).Value = fours.unit;
|
||||
// ws.Cell(row, 5).Value = fours.material_cost;
|
||||
// ws.Cell(row, 6).Value = fours.material_cost;
|
||||
// ws.Cell(row, 7).Value = fours.labor_unit;
|
||||
// ws.Cell(row, 8).Value = fours.labor_cost;
|
||||
// ws.Cell(row, 9).Value = fours.total_amount;
|
||||
// ws.Cell(row, 10).Value = fours.note;
|
||||
//
|
||||
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName =
|
||||
// "TH SarabunPSK";
|
||||
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 14;
|
||||
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.WrapText = true;
|
||||
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.Vertical =
|
||||
// XLAlignmentVerticalValues.Center;
|
||||
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.OutsideBorder =
|
||||
// XLBorderStyleValues.Thin;
|
||||
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).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, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||
// //ws.Range(ws.Cell(5, 1), ws.Cell(5, 4)).Style.Font.Bold = true;
|
||||
// //ws.Range(ws.Cell(6, 1), ws.Cell(6, 4)).Style.Border.BottomBorder = XLBorderStyleValues.Double;
|
||||
// //ws.Range(ws.Cell(6, 1), ws.Cell(6, 4)).Style.Font.Bold = true;
|
||||
// //ws.Cell(row, 3).Style.NumberFormat.NumberFormatId = 2;
|
||||
// //ws.Cell(row, 3).DataType = XLDataType.Number;
|
||||
// //ws.Cell(row,3).SetDataType(XLDataType.Number);
|
||||
// ws.Range(ws.Cell(row, 5), ws.Cell(row, 9)).Style.NumberFormat.SetFormat("#,#");
|
||||
//
|
||||
// row++;
|
||||
// }
|
||||
// if (fours.operational_activities == "รวมทั้งสิ้น")
|
||||
// {
|
||||
//
|
||||
// ws.Cell(row, 1).Value = null;
|
||||
// ws.Cell(row, 2).Value = fours.operational_activities;
|
||||
// ws.Cell(row, 3).Value = null;
|
||||
// ws.Cell(row, 4).Value = null;
|
||||
// ws.Cell(row, 5).Value = null;
|
||||
// ws.Cell(row, 6).Value = null;
|
||||
// ws.Cell(row, 7).Value = null;
|
||||
// ws.Cell(row, 8).Value = null;
|
||||
// ws.Cell(row, 9).Value = sumall;
|
||||
// ws.Cell(row, 10).Value = null;
|
||||
//
|
||||
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName =
|
||||
// "TH SarabunPSK";
|
||||
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 14;
|
||||
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.WrapText = true;
|
||||
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.Vertical =
|
||||
// XLAlignmentVerticalValues.Center;
|
||||
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.OutsideBorder =
|
||||
// XLBorderStyleValues.Thin;
|
||||
// ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.RightBorder =
|
||||
// XLBorderStyleValues.Thin;
|
||||
// ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell(row, 2).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, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
// ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||
// ws.Cell(row, 2).Style.Font.Bold = true;
|
||||
// ws.Cell(row, 9).Style.Font.Bold = true;
|
||||
// //ws.Range(ws.Cell(6, 1), ws.Cell(6, 4)).Style.Border.BottomBorder = XLBorderStyleValues.Double;
|
||||
// //ws.Range(ws.Cell(6, 1), ws.Cell(6, 4)).Style.Font.Bold = true;
|
||||
// //ws.Cell(row, 3).Style.NumberFormat.NumberFormatId = 2;
|
||||
// //ws.Cell(row, 3).DataType = XLDataType.Number;
|
||||
// //ws.Cell(row,3).SetDataType(XLDataType.Number);
|
||||
// ws.Range(ws.Cell(row, 5), ws.Cell(row, 9)).Style.NumberFormat.SetFormat("#,#");
|
||||
//
|
||||
// row++;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// using (var stream = new MemoryStream())
|
||||
// {
|
||||
// workbook.SaveAs(stream);
|
||||
// var content = stream.ToArray();
|
||||
// string date = DateTime.Now.ToString("yyyyMMddHHmmss");
|
||||
// return File(
|
||||
// content,
|
||||
// "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
// "materials_construction_" + date + ".xlsx");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -41,11 +41,7 @@ namespace rmutr_report.Models
|
||||
public string budget_spending_plan_year { get; set; }
|
||||
//public decimal? spending_plan_amount { get; set; }
|
||||
public List<materials_construction_labor> material_construction_labor{ get; set; }
|
||||
// public decimal? material_amount { get; set; }
|
||||
// public decimal? material_unit { get; set; }
|
||||
// public decimal? material_cost { get; set; }
|
||||
// public decimal? labor_unit{ get; set; }
|
||||
// public decimal? labor_cost { get; set; }
|
||||
public string url_file { get; set; }
|
||||
public decimal? material_total_amount { get; set; }
|
||||
public decimal? full_limit { get; set; }
|
||||
public decimal? national_budget { get; set; }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Report ScriptLanguage="CSharp" ReportInfo.Created="03/02/2023 21:57:02" ReportInfo.Modified="03/22/2023 21:36:15" ReportInfo.CreatorVersion="2022.1.0.0">
|
||||
<Report ScriptLanguage="CSharp" ReportInfo.Created="03/02/2023 21:57:02" ReportInfo.Modified="03/22/2023 22:07:39" ReportInfo.CreatorVersion="2022.1.0.0">
|
||||
<Dictionary>
|
||||
<BusinessObjectDataSource Name="building_four" ReferenceName="building_four" DataType="null" Enabled="true">
|
||||
<Column Name="agency_faculty" DataType="System.String"/>
|
||||
@@ -126,6 +126,7 @@
|
||||
<Column Name="total_amount" DataType="System.Decimal"/>
|
||||
<Column Name="note" DataType="System.String"/>
|
||||
</BusinessObjectDataSource>
|
||||
<Column Name="url_file" DataType="System.String"/>
|
||||
<BusinessObjectDataSource Name="detail_division_work" DataType="null" Enabled="true">
|
||||
<Column Name="budget_year" DataType="System.String"/>
|
||||
<Column Name="amount" DataType="System.Decimal"/>
|
||||
@@ -582,6 +583,11 @@
|
||||
</ReportSummaryBand>
|
||||
</ReportPage>
|
||||
<ReportPage Name="Page4" RawPaperSize="9" Watermark.Font="Arial, 60pt">
|
||||
<DataBand Name="Data31" Width="718.2" Height="28.35">
|
||||
<TextObject Name="Text118" Width="812.7" Height="28.35" Hyperlink.Expression="[building_four.url_file]" Text="[building_four.url_file]" Font="TH SarabunPSK, 16pt"/>
|
||||
</DataBand>
|
||||
</ReportPage>
|
||||
<ReportPage Name="Page5" RawPaperSize="9" Watermark.Font="Arial, 60pt">
|
||||
<DataBand Name="Data26" Width="718.2" Height="113.4">
|
||||
<TextObject Name="Text3" Width="718.2" Height="28.35" Text="14. รายละเอียดการแบ่งงวดงานรายการก่อสร้างผูกพัน" Font="TH SarabunPSK, 16pt, style=Bold"/>
|
||||
<TextObject Name="Text108" Left="151.2" Top="28.35" Width="548.1" Height="28.35" Text="วงเงินเต็มรูป [building_four.full_limit] บาท" Format="Number" Format.UseLocale="true" Format.DecimalDigits="0" Font="TH SarabunPSK, 16pt"/>
|
||||
|
||||
Reference in New Issue
Block a user