update total

This commit is contained in:
kamonwan taengsuk
2022-08-25 11:19:09 +07:00
parent 429a4ceb7a
commit a34adce608
5 changed files with 47 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@@ -27,6 +28,20 @@ namespace rmutr_report.Controllers
[ApiExplorerSettings(GroupName = "reports")] [ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetSum1Report([FromRoute] string type, [FromBody] List<budget_report> budget_reports) public IActionResult GetSum1Report([FromRoute] string type, [FromBody] List<budget_report> budget_reports)
{ {
foreach (var x in budget_reports)
{
int sum1 = budget_reports.Sum(g => int.Parse(g.salaya));
x.sum1 = sum1;
int sum2 = budget_reports.Sum(g => int.Parse(g.bophitphimuk));
x.sum2 = sum2;
int sum3 = budget_reports.Sum(g => int.Parse(g.pohchang));
x.sum3 = sum3;
int sum4 = budget_reports.Sum(g => int.Parse(g.klai_kangwon));
x.sum4 = sum4;
int sum5 = budget_reports.Sum(g => int.Parse(g.total));
x.sum5 = sum5;
}
Report report = new Report(); Report report = new Report();
report.Load(_setting.report_path + "budget_report.frx"); report.Load(_setting.report_path + "budget_report.frx");
report.RegisterData(budget_reports, "budget_report"); report.RegisterData(budget_reports, "budget_report");

View File

@@ -8,5 +8,11 @@ namespace rmutr_report.Models
public string pohchang { get; set; } public string pohchang { get; set; }
public string klai_kangwon { get; set; } public string klai_kangwon { get; set; }
public string total { get; set; } public string total { get; set; }
public int? sum1 { get; set; }
public int? sum2 { get; set; }
public int? sum3 { get; set; }
public int? sum4 { get; set; }
public int? sum5 { get; set; }
} }
} }

View File

@@ -1 +0,0 @@
<StaticWebAssets Version="1.0" />

View File

@@ -163,5 +163,4 @@ C:\Users\Mercedes Benz\Documents\rmutr_report\obj\Debug\net5.0\rmutr-report.xml
C:\Users\Mercedes Benz\Documents\rmutr_report\obj\Debug\net5.0\rmutr-report.pdb C:\Users\Mercedes Benz\Documents\rmutr_report\obj\Debug\net5.0\rmutr-report.pdb
C:\Users\Mercedes Benz\Documents\rmutr_report\obj\Debug\net5.0\rmutr-report.genruntimeconfig.cache C:\Users\Mercedes Benz\Documents\rmutr_report\obj\Debug\net5.0\rmutr-report.genruntimeconfig.cache
C:\Users\Mercedes Benz\Documents\rmutr_report\bin\Debug\net5.0\Swashbuckle.AspNetCore.Annotations.dll C:\Users\Mercedes Benz\Documents\rmutr_report\bin\Debug\net5.0\Swashbuckle.AspNetCore.Annotations.dll
C:\Users\Mercedes Benz\Documents\rmutr_report\bin\Debug\net5.0\rmutr-report.StaticWebAssets.xml
C:\Users\Mercedes Benz\Documents\rmutr_report\obj\Debug\net5.0\refint\rmutr-report.dll C:\Users\Mercedes Benz\Documents\rmutr_report\obj\Debug\net5.0\refint\rmutr-report.dll

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="09/14/2021 15:20:39" ReportInfo.Modified="08/24/2022 21:10:49" ReportInfo.CreatorVersion="2022.1.0.0"> <Report ScriptLanguage="CSharp" ReportInfo.Created="09/14/2021 15:20:39" ReportInfo.Modified="08/25/2022 10:30:24" ReportInfo.CreatorVersion="2022.1.0.0">
<Dictionary> <Dictionary>
<BusinessObjectDataSource Name="budget_report" ReferenceName="budget_report" DataType="null" Enabled="true"> <BusinessObjectDataSource Name="budget_report" ReferenceName="budget_report" DataType="null" Enabled="true">
<Column Name="fac" DataType="System.String"/> <Column Name="fac" DataType="System.String"/>
@@ -8,6 +8,11 @@
<Column Name="pohchang" DataType="System.String"/> <Column Name="pohchang" DataType="System.String"/>
<Column Name="klai_kangwon" DataType="System.String"/> <Column Name="klai_kangwon" DataType="System.String"/>
<Column Name="total" DataType="System.String"/> <Column Name="total" DataType="System.String"/>
<Column Name="sum1" DataType="System.Int32"/>
<Column Name="sum2" DataType="System.Int32"/>
<Column Name="sum3" DataType="System.Int32"/>
<Column Name="sum4" DataType="System.Int32"/>
<Column Name="sum5" DataType="System.Int32"/>
</BusinessObjectDataSource> </BusinessObjectDataSource>
</Dictionary> </Dictionary>
<ReportPage Name="Page1" PaperWidth="250" Watermark.Font="Arial, 60pt"> <ReportPage Name="Page1" PaperWidth="250" Watermark.Font="Arial, 60pt">
@@ -61,5 +66,25 @@
</TableObject> </TableObject>
</DataBand> </DataBand>
</DataBand> </DataBand>
<ReportSummaryBand Name="ReportSummary1" Top="97.42" Width="869.4" Height="28.35">
<TableObject Name="Table24" Width="869.4" Height="28.35" Border.Lines="All">
<TableColumn Name="Column167" Width="37.8"/>
<TableColumn Name="Column168" Width="311.85"/>
<TableColumn Name="Column169" Width="113.4"/>
<TableColumn Name="Column170" Width="113.4"/>
<TableColumn Name="Column171" Width="113.4"/>
<TableColumn Name="Column172" Width="103.95"/>
<TableColumn Name="Column173" Width="75.6"/>
<TableRow Name="Row24" Height="28.35">
<TableCell Name="Cell227" Fill.Color="Gainsboro" Text="รวม" HorzAlign="Center" VertAlign="Center" Font="TH Sarabun New, 11pt" ColSpan="2"/>
<TableCell Name="Cell228" Border.Lines="All" Fill.Color="Gainsboro" VertAlign="Center" Font="TH Sarabun New, 11pt"/>
<TableCell Name="Cell229" Border.Lines="All" Fill.Color="Gainsboro" Text="[budget_report.sum1]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="0" HorzAlign="Center" VertAlign="Center" Font="TH Sarabun New, 11pt"/>
<TableCell Name="Cell230" Border.Lines="All" Fill.Color="Gainsboro" Text="[budget_report.sum2]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="0" HorzAlign="Center" VertAlign="Center" Font="TH Sarabun New, 11pt"/>
<TableCell Name="Cell231" Border.Lines="All" Fill.Color="Gainsboro" Text="[budget_report.sum3]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="0" HorzAlign="Center" VertAlign="Center" Font="TH Sarabun New, 11pt"/>
<TableCell Name="Cell232" Border.Lines="All" Fill.Color="Gainsboro" Text="[budget_report.sum4]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="0" HorzAlign="Center" VertAlign="Center" Font="TH Sarabun New, 11pt"/>
<TableCell Name="Cell233" Border.Lines="All" Fill.Color="Gainsboro" Text="[budget_report.sum5]" Format="Number" Format.UseLocale="true" Format.DecimalDigits="0" HorzAlign="Center" VertAlign="Center" Font="TH Sarabun New, 11pt"/>
</TableRow>
</TableObject>
</ReportSummaryBand>
</ReportPage> </ReportPage>
</Report> </Report>