This commit is contained in:
@@ -26,13 +26,14 @@ namespace rmutr_report.Controllers
|
||||
{
|
||||
this._setting = setting;
|
||||
}
|
||||
|
||||
[SwaggerOperation("สรุปแผนความต้องการ รายการครุภัณฑ์")]
|
||||
[HttpPost, Route("reports/summary_of_equipment/{type}")]
|
||||
[ApiExplorerSettings(GroupName = "reports")]
|
||||
public IActionResult GetSum1Report([FromRoute] string type,
|
||||
[FromBody] summary_of_equipment summary_of_equipments)
|
||||
{
|
||||
var _summary_of_equipment = new List<summary_of_equipment>() {summary_of_equipments};
|
||||
var _summary_of_equipment = new List<summary_of_equipment>() { summary_of_equipments };
|
||||
var workbook = new XLWorkbook();
|
||||
var ws = workbook.Worksheets.Add("รายการก่อสร้างอาคาร");
|
||||
var imagePath = _setting.report_path + @"Logo-RMUTR.png";
|
||||
@@ -299,6 +300,7 @@ namespace rmutr_report.Controllers
|
||||
// }
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[SwaggerOperation("สรุปแผนความต้องการ รายการครุภัณฑ์ 5 ปี")]
|
||||
[HttpPost, Route("reports/summary_of_equipment_five_year/{type}")]
|
||||
[ApiExplorerSettings(GroupName = "reports")]
|
||||
@@ -545,21 +547,86 @@ namespace rmutr_report.Controllers
|
||||
ws.Range(ws.Cell(row, 8), ws.Cell(row, 14)).Style.NumberFormat.SetFormat("#,#");
|
||||
row++;
|
||||
}
|
||||
if (equipments.color == 2)
|
||||
|
||||
if (equipments.color == 2)
|
||||
{
|
||||
ws.Cell(row, 1).Value = null;
|
||||
ws.Cell(row, 2).Value = equipments.list;
|
||||
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 = equipments.unit_price;
|
||||
ws.Cell(row, 9).Value = equipments.price_1;
|
||||
ws.Cell(row, 10).Value = equipments.price_2;
|
||||
ws.Cell(row, 11).Value = equipments.price_3;
|
||||
ws.Cell(row, 12).Value = equipments.price_4;
|
||||
ws.Cell(row, 13).Value = equipments.price_5;
|
||||
ws.Cell(row, 14).Value = null;
|
||||
ws.Cell(row, 15).Value = null;
|
||||
ws.Cell(row, 16).Value = null;
|
||||
ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 15).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 16).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Font.FontName =
|
||||
"TH Sarabun New";
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Font.FontSize = 12;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.WrapText = true;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.Vertical =
|
||||
XLAlignmentVerticalValues.Center;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Fill.BackgroundColor = XLColor.BabyBlue;
|
||||
|
||||
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.Right;
|
||||
ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||
ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||
ws.Range(ws.Cell(row, 8), ws.Cell(row, 14)).Style.NumberFormat.SetFormat("#,#");
|
||||
row++;
|
||||
}
|
||||
|
||||
foreach (var equipments1 in equipments.data)
|
||||
{
|
||||
if (equipments1.color == 3)
|
||||
{
|
||||
ws.Cell(row, 1).Value = null;
|
||||
ws.Cell(row, 2).Value = equipments.list;
|
||||
ws.Cell(row, 2).Value = equipments1.faculty_name;
|
||||
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 = equipments.unit_price;
|
||||
ws.Cell(row, 9).Value = equipments.price_1;
|
||||
ws.Cell(row, 10).Value = equipments.price_2;
|
||||
ws.Cell(row, 11).Value = equipments.price_3;
|
||||
ws.Cell(row, 12).Value = equipments.price_4;
|
||||
ws.Cell(row, 13).Value = equipments.price_5;
|
||||
ws.Cell(row, 8).Value = equipments1.unit_price;
|
||||
ws.Cell(row, 9).Value = equipments1.price_1;
|
||||
ws.Cell(row, 10).Value = equipments1.price_2;
|
||||
ws.Cell(row, 11).Value = equipments1.price_3;
|
||||
ws.Cell(row, 12).Value = equipments1.price_4;
|
||||
ws.Cell(row, 13).Value = equipments1.price_5;
|
||||
ws.Cell(row, 14).Value = null;
|
||||
ws.Cell(row, 15).Value = null;
|
||||
ws.Cell(row, 16).Value = null;
|
||||
@@ -585,8 +652,8 @@ namespace rmutr_report.Controllers
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.WrapText = true;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.Vertical =
|
||||
XLAlignmentVerticalValues.Center;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Fill.BackgroundColor = XLColor.BabyBlue;
|
||||
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Fill.BackgroundColor =
|
||||
XLColor.LavenderPurple;
|
||||
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;
|
||||
@@ -607,23 +674,24 @@ namespace rmutr_report.Controllers
|
||||
row++;
|
||||
}
|
||||
|
||||
foreach (var equipments1 in equipments.data)
|
||||
{
|
||||
if (equipments1.color == 3)
|
||||
|
||||
foreach (var equipments2 in equipments1.data)
|
||||
{
|
||||
if (equipments2.color == 4)
|
||||
{
|
||||
ws.Cell(row, 1).Value = null;
|
||||
ws.Cell(row, 2).Value = equipments1.faculty_name;
|
||||
ws.Cell(row, 2).Value = equipments2.list;
|
||||
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 = equipments1.unit_price;
|
||||
ws.Cell(row, 9).Value = equipments1.price_1;
|
||||
ws.Cell(row, 10).Value = equipments1.price_2;
|
||||
ws.Cell(row, 11).Value = equipments1.price_3;
|
||||
ws.Cell(row, 12).Value = equipments1.price_4;
|
||||
ws.Cell(row, 13).Value = equipments1.price_5;
|
||||
ws.Cell(row, 8).Value = equipments2.unit_price;
|
||||
ws.Cell(row, 9).Value = equipments2.price_1;
|
||||
ws.Cell(row, 10).Value = equipments2.price_2;
|
||||
ws.Cell(row, 11).Value = equipments2.price_3;
|
||||
ws.Cell(row, 12).Value = equipments2.price_4;
|
||||
ws.Cell(row, 13).Value = equipments2.price_5;
|
||||
ws.Cell(row, 14).Value = null;
|
||||
ws.Cell(row, 15).Value = null;
|
||||
ws.Cell(row, 16).Value = null;
|
||||
@@ -650,7 +718,7 @@ namespace rmutr_report.Controllers
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.Vertical =
|
||||
XLAlignmentVerticalValues.Center;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Fill.BackgroundColor =
|
||||
XLColor.LavenderPurple;
|
||||
XLColor.GrannySmithApple;
|
||||
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;
|
||||
@@ -672,74 +740,8 @@ namespace rmutr_report.Controllers
|
||||
}
|
||||
|
||||
|
||||
foreach (var equipments2 in equipments1.data)
|
||||
{
|
||||
if (equipments2.color == 4)
|
||||
{
|
||||
ws.Cell(row, 1).Value = null;
|
||||
ws.Cell(row, 2).Value = equipments2.list;
|
||||
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 = equipments2.unit_price;
|
||||
ws.Cell(row, 9).Value = equipments2.price_1;
|
||||
ws.Cell(row, 10).Value = equipments2.price_2;
|
||||
ws.Cell(row, 11).Value = equipments2.price_3;
|
||||
ws.Cell(row, 12).Value = equipments2.price_4;
|
||||
ws.Cell(row, 13).Value = equipments2.price_5;
|
||||
ws.Cell(row, 14).Value = null;
|
||||
ws.Cell(row, 15).Value = null;
|
||||
ws.Cell(row, 16).Value = null;
|
||||
ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 15).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 16).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Font.FontName =
|
||||
"TH Sarabun New";
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Font.FontSize = 12;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.WrapText = true;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Alignment.Vertical =
|
||||
XLAlignmentVerticalValues.Center;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 16)).Style.Fill.BackgroundColor =
|
||||
XLColor.GrannySmithApple;
|
||||
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.Right;
|
||||
ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||
ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||
ws.Range(ws.Cell(row, 8), ws.Cell(row, 14)).Style.NumberFormat.SetFormat("#,#");
|
||||
row++;
|
||||
}
|
||||
|
||||
|
||||
foreach (var equipment3 in equipments2.data)
|
||||
{
|
||||
|
||||
ws.Cell(row, 1).Value = no;
|
||||
no++;
|
||||
ws.Cell(row, 2).Value = equipment3.list;
|
||||
@@ -906,7 +908,7 @@ namespace rmutr_report.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
var _statement_of_equipment = new List<statement_of_equipment>() {equipments};
|
||||
var _statement_of_equipment = new List<statement_of_equipment>() { equipments };
|
||||
|
||||
Report report = new Report();
|
||||
report.Load(_setting.report_path + "statement_of_equipment.frx");
|
||||
@@ -1267,10 +1269,84 @@ namespace rmutr_report.Controllers
|
||||
ws.Range(ws.Cell(row, 11), ws.Cell(row, 16)).Style.NumberFormat.SetFormat("#,#");
|
||||
row++;
|
||||
}
|
||||
if (buildings.color == 2)
|
||||
|
||||
if (buildings.color == 2)
|
||||
{
|
||||
ws.Cell(row, 1).Value = null;
|
||||
ws.Cell(row, 2).Value = buildings.list;
|
||||
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 = null;
|
||||
ws.Cell(row, 10).Value = null;
|
||||
ws.Cell(row, 11).Value = buildings.budget;
|
||||
ws.Cell(row, 12).Value = buildings.price_1;
|
||||
ws.Cell(row, 13).Value = buildings.price_2;
|
||||
ws.Cell(row, 14).Value = buildings.price_3;
|
||||
ws.Cell(row, 15).Value = buildings.price_4;
|
||||
ws.Cell(row, 16).Value = buildings.price_5;
|
||||
ws.Cell(row, 17).Value = null;
|
||||
ws.Cell(row, 18).Value = null;
|
||||
ws.Cell(row, 19).Value = null;
|
||||
ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 15).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 16).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 17).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 18).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 19).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontName =
|
||||
"TH Sarabun New";
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontSize = 11;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.WrapText = true;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.Vertical =
|
||||
XLAlignmentVerticalValues.Center;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Fill.BackgroundColor =
|
||||
XLColor.BabyBlue;
|
||||
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.Left;
|
||||
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.Center;
|
||||
ws.Cell(row, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 17).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 18).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 19).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||
ws.Range(ws.Cell(row, 11), ws.Cell(row, 16)).Style.NumberFormat.SetFormat("#,#");
|
||||
row++;
|
||||
}
|
||||
|
||||
foreach (var buildings1 in buildings.data)
|
||||
{
|
||||
if (buildings1.color == 3)
|
||||
{
|
||||
ws.Cell(row, 1).Value = null;
|
||||
ws.Cell(row, 2).Value = buildings.list;
|
||||
ws.Cell(row, 2).Value = buildings1.faculty_name;
|
||||
ws.Cell(row, 3).Value = null;
|
||||
ws.Cell(row, 4).Value = null;
|
||||
ws.Cell(row, 5).Value = null;
|
||||
@@ -1279,12 +1355,12 @@ namespace rmutr_report.Controllers
|
||||
ws.Cell(row, 8).Value = null;
|
||||
ws.Cell(row, 9).Value = null;
|
||||
ws.Cell(row, 10).Value = null;
|
||||
ws.Cell(row, 11).Value = buildings.budget;
|
||||
ws.Cell(row, 12).Value = buildings.price_1;
|
||||
ws.Cell(row, 13).Value = buildings.price_2;
|
||||
ws.Cell(row, 14).Value = buildings.price_3;
|
||||
ws.Cell(row, 15).Value = buildings.price_4;
|
||||
ws.Cell(row, 16).Value = buildings.price_5;
|
||||
ws.Cell(row, 11).Value = buildings1.budget;
|
||||
ws.Cell(row, 12).Value = buildings1.price_1;
|
||||
ws.Cell(row, 13).Value = buildings1.price_2;
|
||||
ws.Cell(row, 14).Value = buildings1.price_3;
|
||||
ws.Cell(row, 15).Value = buildings1.price_4;
|
||||
ws.Cell(row, 16).Value = buildings1.price_5;
|
||||
ws.Cell(row, 17).Value = null;
|
||||
ws.Cell(row, 18).Value = null;
|
||||
ws.Cell(row, 19).Value = null;
|
||||
@@ -1314,7 +1390,7 @@ namespace rmutr_report.Controllers
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.Vertical =
|
||||
XLAlignmentVerticalValues.Center;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Fill.BackgroundColor =
|
||||
XLColor.BabyBlue;
|
||||
XLColor.LavenderPurple;
|
||||
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;
|
||||
@@ -1324,26 +1400,30 @@ namespace rmutr_report.Controllers
|
||||
ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||
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.Center;
|
||||
ws.Cell(row, 10).Style.Alignment.Horizontal =
|
||||
XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 17).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 18).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 17).Style.Alignment.Horizontal =
|
||||
XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 18).Style.Alignment.Horizontal =
|
||||
XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 19).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||
ws.Range(ws.Cell(row, 11), ws.Cell(row, 16)).Style.NumberFormat.SetFormat("#,#");
|
||||
ws.Range(ws.Cell(row, 11), ws.Cell(row, 16)).Style.NumberFormat
|
||||
.SetFormat("#,#");
|
||||
row++;
|
||||
}
|
||||
|
||||
foreach (var buildings1 in buildings.data)
|
||||
{
|
||||
if (buildings1.color == 3)
|
||||
foreach (var buildings2 in buildings1.data)
|
||||
{
|
||||
if (buildings2.color == 4)
|
||||
{
|
||||
ws.Cell(row, 1).Value = null;
|
||||
ws.Cell(row, 2).Value = buildings1.faculty_name;
|
||||
ws.Cell(row, 2).Value = buildings2.list;
|
||||
ws.Cell(row, 3).Value = null;
|
||||
ws.Cell(row, 4).Value = null;
|
||||
ws.Cell(row, 5).Value = null;
|
||||
@@ -1352,12 +1432,12 @@ namespace rmutr_report.Controllers
|
||||
ws.Cell(row, 8).Value = null;
|
||||
ws.Cell(row, 9).Value = null;
|
||||
ws.Cell(row, 10).Value = null;
|
||||
ws.Cell(row, 11).Value = buildings1.budget;
|
||||
ws.Cell(row, 12).Value = buildings1.price_1;
|
||||
ws.Cell(row, 13).Value = buildings1.price_2;
|
||||
ws.Cell(row, 14).Value = buildings1.price_3;
|
||||
ws.Cell(row, 15).Value = buildings1.price_4;
|
||||
ws.Cell(row, 16).Value = buildings1.price_5;
|
||||
ws.Cell(row, 11).Value = buildings2.budget;
|
||||
ws.Cell(row, 12).Value = buildings2.price_1;
|
||||
ws.Cell(row, 13).Value = buildings2.price_2;
|
||||
ws.Cell(row, 14).Value = buildings2.price_3;
|
||||
ws.Cell(row, 15).Value = buildings2.price_4;
|
||||
ws.Cell(row, 16).Value = buildings2.price_5;
|
||||
ws.Cell(row, 17).Value = null;
|
||||
ws.Cell(row, 18).Value = null;
|
||||
ws.Cell(row, 19).Value = null;
|
||||
@@ -1387,7 +1467,7 @@ namespace rmutr_report.Controllers
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.Vertical =
|
||||
XLAlignmentVerticalValues.Center;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Fill.BackgroundColor =
|
||||
XLColor.LavenderPurple;
|
||||
XLColor.GrannySmithApple;
|
||||
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;
|
||||
@@ -1415,88 +1495,9 @@ namespace rmutr_report.Controllers
|
||||
row++;
|
||||
}
|
||||
|
||||
foreach (var buildings2 in buildings1.data)
|
||||
{
|
||||
if (buildings2.color == 4)
|
||||
{
|
||||
ws.Cell(row, 1).Value = null;
|
||||
ws.Cell(row, 2).Value = buildings2.list;
|
||||
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 = null;
|
||||
ws.Cell(row, 10).Value = null;
|
||||
ws.Cell(row, 11).Value = buildings2.budget;
|
||||
ws.Cell(row, 12).Value = buildings2.price_1;
|
||||
ws.Cell(row, 13).Value = buildings2.price_2;
|
||||
ws.Cell(row, 14).Value = buildings2.price_3;
|
||||
ws.Cell(row, 15).Value = buildings2.price_4;
|
||||
ws.Cell(row, 16).Value = buildings2.price_5;
|
||||
ws.Cell(row, 17).Value = null;
|
||||
ws.Cell(row, 18).Value = null;
|
||||
ws.Cell(row, 19).Value = null;
|
||||
ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 3).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 4).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 5).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 6).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 7).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 8).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 9).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 10).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 11).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 12).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 13).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 14).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 15).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 16).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 17).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 18).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Cell(row, 19).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontName =
|
||||
"TH Sarabun New";
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Font.FontSize = 11;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.WrapText = true;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Alignment.Vertical =
|
||||
XLAlignmentVerticalValues.Center;
|
||||
ws.Range(ws.Cell(row, 1), ws.Cell(row, 19)).Style.Fill.BackgroundColor =
|
||||
XLColor.GrannySmithApple;
|
||||
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.Left;
|
||||
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.Center;
|
||||
ws.Cell(row, 11).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 12).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 13).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 14).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 15).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 16).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right;
|
||||
ws.Cell(row, 17).Style.Alignment.Horizontal =
|
||||
XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 18).Style.Alignment.Horizontal =
|
||||
XLAlignmentHorizontalValues.Center;
|
||||
ws.Cell(row, 19).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||
ws.Range(ws.Cell(row, 11), ws.Cell(row, 16)).Style.NumberFormat
|
||||
.SetFormat("#,#");
|
||||
row++;
|
||||
}
|
||||
|
||||
|
||||
foreach (var building3 in buildings2.data)
|
||||
{
|
||||
|
||||
|
||||
ws.Cell(row, 1).Value = no;
|
||||
no++;
|
||||
ws.Cell(row, 2).Value = building3.list;
|
||||
@@ -1585,6 +1586,7 @@ namespace rmutr_report.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[SwaggerOperation("สรุปงบลงทุน")]
|
||||
[HttpPost, Route("reports/investment_budget_summary/{type}")]
|
||||
[ApiExplorerSettings(GroupName = "reports")]
|
||||
@@ -1593,16 +1595,18 @@ namespace rmutr_report.Controllers
|
||||
{
|
||||
foreach (var detail in investmentBudget.data)
|
||||
{
|
||||
if (detail.topic_type==1)
|
||||
if (detail.topic_type == 1)
|
||||
{
|
||||
detail.row_no = null;
|
||||
}
|
||||
if (detail.topic_type==3)
|
||||
}
|
||||
|
||||
if (detail.topic_type == 3)
|
||||
{
|
||||
detail.row_no = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
var investmentBudgetSummaries = new List<investment_budget_summary>() { investmentBudget };
|
||||
|
||||
var investmentBudgetSummaries = new List<investment_budget_summary>() { investmentBudget };
|
||||
Report report = new Report();
|
||||
report.Load(_setting.report_path + "investment_budget_summary.frx");
|
||||
report.RegisterData(investmentBudgetSummaries, "investment_budget_summary");
|
||||
@@ -1630,6 +1634,7 @@ namespace rmutr_report.Controllers
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[SwaggerOperation("สรุป MTEF")]
|
||||
[HttpPost, Route("reports/summary_mtef/{type}")]
|
||||
[ApiExplorerSettings(GroupName = "reports")]
|
||||
@@ -1682,13 +1687,13 @@ namespace rmutr_report.Controllers
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[SwaggerOperation("MTEF แผนงาน ผลผลิต")]
|
||||
[HttpPost, Route("reports/mtef_plan/{type}")]
|
||||
[ApiExplorerSettings(GroupName = "reports")]
|
||||
public IActionResult GetMtefPlanReport([FromRoute] string type,
|
||||
[FromBody] mtef_plan mtef)
|
||||
{
|
||||
|
||||
var mtefs = new List<mtef_plan>() { mtef };
|
||||
Report report = new Report();
|
||||
report.Load(_setting.report_path + "mtef_plan.frx");
|
||||
@@ -1717,5 +1722,198 @@ namespace rmutr_report.Controllers
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[SwaggerOperation("ตารางสรุปกรอบความต้องการและสถานภาพความพร้อมรายการครุภัณฑ์ (รายการปีเดียว)")]
|
||||
[HttpPost, Route("reports/summary_demand_status_equipment/{type}")]
|
||||
[ApiExplorerSettings(GroupName = "reports")]
|
||||
public IActionResult GetSumDemandReport([FromRoute] string type,
|
||||
[FromBody] summary_demand_status_equipment summaryDemandStatus)
|
||||
{
|
||||
summaryDemandStatus.request_assets_year_1 = summaryDemandStatus.request_assets_year_1.Substring(2, 2);
|
||||
summaryDemandStatus.request_assets_year_2 = summaryDemandStatus.request_assets_year_2.Substring(2, 2);
|
||||
summaryDemandStatus.request_assets_year_3 = summaryDemandStatus.request_assets_year_3.Substring(2, 2);
|
||||
foreach (var detail in summaryDemandStatus.data)
|
||||
{
|
||||
if (detail.topic_type != 5)
|
||||
{
|
||||
detail.row_no = null;
|
||||
detail.conform1 = null;
|
||||
detail.conform2 = null;
|
||||
detail.conform3 = null;
|
||||
detail.standard_price1 = null;
|
||||
detail.standard_price2 = null;
|
||||
detail.standard_price3 = null;
|
||||
detail.unique_feature1 = null;
|
||||
detail.unique_feature2 = null;
|
||||
detail.unique_feature3 = null;
|
||||
}
|
||||
if (detail.topic_type == 2)
|
||||
{
|
||||
detail.topic = "- " + detail.topic;
|
||||
}
|
||||
if (detail.topic_type == 5)
|
||||
{
|
||||
|
||||
if (detail.conform_1 == true)
|
||||
{
|
||||
detail.conform1 = "P";
|
||||
}
|
||||
|
||||
if (detail.conform_2 == true)
|
||||
{
|
||||
detail.conform2 = "P";
|
||||
}
|
||||
|
||||
if (detail.conform_3 == true)
|
||||
{
|
||||
detail.conform3 = "P";
|
||||
}
|
||||
|
||||
if (detail.standard_price_1 == true)
|
||||
{
|
||||
detail.standard_price1 = "P";
|
||||
}
|
||||
|
||||
if (detail.standard_price_2 == true)
|
||||
{
|
||||
detail.standard_price2 = "P";
|
||||
}
|
||||
|
||||
if (detail.standard_price_3 == true)
|
||||
{
|
||||
detail.standard_price3 = "P";
|
||||
}
|
||||
|
||||
if (detail.unique_feature_1 == true)
|
||||
{
|
||||
detail.unique_feature1 = "P";
|
||||
}
|
||||
|
||||
if (detail.unique_feature_2 == true)
|
||||
{
|
||||
detail.unique_feature2 = "P";
|
||||
}
|
||||
|
||||
if (detail.unique_feature_3 == true)
|
||||
{
|
||||
detail.unique_feature3 = "P";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var statusEquipments = new List<summary_demand_status_equipment>() { summaryDemandStatus };
|
||||
Report report = new Report();
|
||||
report.Load(_setting.report_path + "summary_demand_status_equipment.frx");
|
||||
report.RegisterData(statusEquipments, "summary_demand_status_equipment");
|
||||
report.Prepare();
|
||||
|
||||
MemoryStream stream = new MemoryStream();
|
||||
switch (type)
|
||||
{
|
||||
case "pdf":
|
||||
PDFExport pdf = new PDFExport();
|
||||
report.Export(pdf, stream);
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
return File(stream, "application/pdf");
|
||||
|
||||
case "xls":
|
||||
case "xlsx":
|
||||
Excel2007Export excel = new Excel2007Export();
|
||||
report.Export(excel, stream);
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
return File(
|
||||
stream,
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
"summary_demand_status_equipment" + ".xlsx");
|
||||
}
|
||||
|
||||
return Ok();
|
||||
}
|
||||
[SwaggerOperation("สรุปภาพรวมการเสนอแผนการปรับปรุงอาคารสถานที่/แผนการจัดหาที่ดินและสิ่งก่อสร้าง")]
|
||||
[HttpPost, Route("reports/summary_overview_building/{type}")]
|
||||
[ApiExplorerSettings(GroupName = "reports")]
|
||||
public IActionResult GetSumDemandReport([FromRoute] string type,
|
||||
[FromBody] summary_overview_building summaryOverviewBuilding)
|
||||
{
|
||||
|
||||
foreach (var detail in summaryOverviewBuilding.data)
|
||||
{
|
||||
if (detail.topic_type != 5)
|
||||
{
|
||||
detail.row_no = null;
|
||||
}
|
||||
if (detail.topic_type == 2)
|
||||
{
|
||||
detail.topic = "- " + detail.topic;
|
||||
}
|
||||
if (detail.topic_type == 5)
|
||||
{
|
||||
|
||||
if (detail.readiness_action_1 == true)
|
||||
{
|
||||
detail.readiness_action1 = "P";
|
||||
}
|
||||
|
||||
if (detail.readiness_action_2 == true)
|
||||
{
|
||||
detail.readiness_action2 = "P";
|
||||
}
|
||||
|
||||
if (detail.readiness_action_3 == true)
|
||||
{
|
||||
detail.readiness_action3 = "P";
|
||||
}
|
||||
|
||||
if (detail.readiness_action_4 == true)
|
||||
{
|
||||
detail.readiness_action4 = "P";
|
||||
}
|
||||
|
||||
|
||||
if (detail.appearance_equipment_1 == true)
|
||||
{
|
||||
detail.appearance_equipment1 = "P";
|
||||
}
|
||||
|
||||
if (detail.appearance_equipment_2 == true)
|
||||
{
|
||||
detail.appearance_equipment2 = "P";
|
||||
}
|
||||
|
||||
if (detail.appearance_equipment_3 == true)
|
||||
{
|
||||
detail.appearance_equipment3 = "P";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var summaryOverview = new List<summary_overview_building>() { summaryOverviewBuilding };
|
||||
Report report = new Report();
|
||||
report.Load(_setting.report_path + "summary_overview_building.frx");
|
||||
report.RegisterData(summaryOverview, "summary_overview_building");
|
||||
report.Prepare();
|
||||
|
||||
MemoryStream stream = new MemoryStream();
|
||||
switch (type)
|
||||
{
|
||||
case "pdf":
|
||||
PDFExport pdf = new PDFExport();
|
||||
report.Export(pdf, stream);
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
return File(stream, "application/pdf");
|
||||
|
||||
case "xls":
|
||||
case "xlsx":
|
||||
Excel2007Export excel = new Excel2007Export();
|
||||
report.Export(excel, stream);
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
return File(
|
||||
stream,
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
"summary_overview_building" + ".xlsx");
|
||||
}
|
||||
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user