This commit is contained in:
kamonwan taengsuk
2023-08-03 14:42:43 +07:00
parent 6c2b784439
commit 63190b8aa3
8 changed files with 383 additions and 43 deletions

View File

@@ -2588,14 +2588,17 @@ namespace rmutr_report.Controllers
{
notation.row_no = "หมายเหตุ : " + "1";
}
if (notation.amount != null)
{
notation.amounts = bath;
notation.amounts = bath;
}
if (notation.amount == null)
{
notation.amounts = null;
notation.amounts = null;
}
foreach (var notation2 in notation.notations_detail)
{
if (notation2.list != null && notation2.amount != null)
@@ -2663,7 +2666,7 @@ namespace rmutr_report.Controllers
{
int row = 1;
foreach (var dataDetail in detail.detail)
{
{
if (dataDetail.topic_type == 5)
{
dataDetail.row_no = row.ToString();
@@ -2707,6 +2710,7 @@ namespace rmutr_report.Controllers
return Ok();
}
[HttpPost, Route("reports/total_budget/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetBudgetTotalReport([FromRoute] string type,
@@ -2715,23 +2719,23 @@ namespace rmutr_report.Controllers
int row = 1;
foreach (var detail2 in budget.data)
{
var a = "- ";
if (detail2.topic_type == 2)
{
detail2.list = a + detail2.list;
}
var a = "- ";
if (detail2.topic_type == 2)
{
detail2.list = a + detail2.list;
}
if (detail2.topic_type == 5)
{
detail2.row_no = row.ToString();
row++;
}
else
{
detail2.row_no = null;
}
if (detail2.topic_type == 5)
{
detail2.row_no = row.ToString();
row++;
}
else
{
detail2.row_no = null;
}
}
var summaryBudget = new List<total_budget>() { budget };
Report report = new Report();
@@ -2763,5 +2767,54 @@ namespace rmutr_report.Controllers
return Ok();
}
[HttpPost, Route("reports/summary_subsidy_projects/{type}")]
[ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetBudgetSubsidySummaryReport([FromRoute] string type,
[FromBody] summary_subsidy_projects budget)
{
int row = 1;
foreach (var detail in budget.data)
{
if (detail.topic_type == 3)
{
detail.row_no = row;
row++;
}
else
{
detail.row_no = null;
}
}
var summaryBudget = new List<summary_subsidy_projects>() { budget };
Report report = new Report();
report.Load(_setting.report_path + "summary_subsidy_projects.frx");
report.RegisterData(summaryBudget, "summary_subsidy_projects");
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",
"project_summary_subsidy" + ".xlsx");
}
return Ok();
}
}
}