feat(kpi): render vision/values/uniqueness/identity indicator sections in budget policy Excel export
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
Mirrors the existing indicator table layout for the 4 new reference sections coming from rmutr-api (unit, target value, 3 responsible-role columns), reusing the same 8-column styling as the strategic indicators.
This commit is contained in:
@@ -269,10 +269,13 @@ namespace rmutr_report.Controllers
|
|||||||
}
|
}
|
||||||
//row++;
|
//row++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WriteReferenceHeaders(ws, _kpi.vision_data, ref row, ref rowno);
|
||||||
|
WriteReferenceHeaders(ws, _kpi.popularity_data, ref row, ref rowno);
|
||||||
|
WriteReferenceHeaders(ws, _kpi.uniqueness_data, ref row, ref rowno);
|
||||||
|
WriteReferenceHeaders(ws, _kpi.identity_data, ref row, ref rowno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//}
|
//}
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@@ -287,6 +290,43 @@ namespace rmutr_report.Controllers
|
|||||||
"kpi_" + date + ".xlsx");
|
"kpi_" + date + ".xlsx");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void WriteReferenceHeaders(IXLWorksheet ws, List<kpi_reference_header> headers, ref int row, ref int rowno)
|
||||||
|
{
|
||||||
|
if (headers == null) return;
|
||||||
|
foreach (var header in headers)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(header.header_1))
|
||||||
|
{
|
||||||
|
ws.Cell(row, 1).Value = header.header_1;
|
||||||
|
ws.Cell(row, 1).Style.Font.Bold = true;
|
||||||
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 8)).Merge().Style.Fill.BackgroundColor = XLColor.Bisque;
|
||||||
|
ws.Range(ws.Cell(row, 1), ws.Cell(row, 8)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;
|
||||||
|
row++;
|
||||||
|
}
|
||||||
|
foreach (var data1 in header.data_detail ?? new List<kpi_data_details2>())
|
||||||
|
{
|
||||||
|
ws.Cell(row, 2).Value = rowno;
|
||||||
|
ws.Cell(row, 3).Value = data1.name;
|
||||||
|
ws.Cell(row, 4).Value = data1.unit;
|
||||||
|
ws.Cell(row, 5).Value = data1.value;
|
||||||
|
ws.Cell(row, 6).Value = data1.responsible_person;
|
||||||
|
ws.Cell(row, 7).Value = data1.responsible_work;
|
||||||
|
ws.Cell(row, 8).Value = data1.collector;
|
||||||
|
for (var c = 1; c <= 8; c++)
|
||||||
|
{
|
||||||
|
ws.Cell(row, c).Style.Border.OutsideBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, c).Style.Border.LeftBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, c).Style.Border.RightBorder = XLBorderStyleValues.Thin;
|
||||||
|
ws.Cell(row, c).Style.Alignment.WrapText = true;
|
||||||
|
}
|
||||||
|
row++;
|
||||||
|
rowno++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[HttpPost, Route("reports/kpi_performance_expenditure_budget/{type}")]
|
[HttpPost, Route("reports/kpi_performance_expenditure_budget/{type}")]
|
||||||
[ApiExplorerSettings(GroupName = "reports")]
|
[ApiExplorerSettings(GroupName = "reports")]
|
||||||
public IActionResult GetKpiBudgetReport([FromRoute] string type, [FromBody] kpi_performance_expenditure_budget kpiPerformance)
|
public IActionResult GetKpiBudgetReport([FromRoute] string type, [FromBody] kpi_performance_expenditure_budget kpiPerformance)
|
||||||
|
|||||||
@@ -8,6 +8,17 @@ namespace rmutr_report.Models
|
|||||||
|
|
||||||
public List<kpi_data_detail> header_data { get; set; }
|
public List<kpi_data_detail> header_data { get; set; }
|
||||||
|
|
||||||
|
public List<kpi_reference_header> vision_data { get; set; }
|
||||||
|
public List<kpi_reference_header> popularity_data { get; set; }
|
||||||
|
public List<kpi_reference_header> uniqueness_data { get; set; }
|
||||||
|
public List<kpi_reference_header> identity_data { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class kpi_reference_header
|
||||||
|
{
|
||||||
|
public string header_1 { get; set; }
|
||||||
|
public List<kpi_data_details2> data_detail { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class kpi_data_detail
|
public class kpi_data_detail
|
||||||
|
|||||||
Reference in New Issue
Block a user