diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/DayWhiteEmbryo/GhWuLiaoInitDb.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/DayWhiteEmbryo/GhWuLiaoInitDb.cs index c961a1a..a6977ec 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/DayWhiteEmbryo/GhWuLiaoInitDb.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjReport/DayWhiteEmbryo/GhWuLiaoInitDb.cs @@ -1,4 +1,6 @@ -using Mesnac.Action.Base; +using DevExpress.Utils.Extensions; + +using Mesnac.Action.Base; using Mesnac.Codd.Session; using Mesnac.Controls.Default; @@ -130,7 +132,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo for (int j = 1; j <= 15; j++) { drTotal[j] = list - .Where(x => x.matCode == j).Sum(x => x.actValue).ToString("#0.00"); + .Where(x => x.matCode == j).Sum(x => x.actValue).ToString("#0.00"); } dt.Rows.Add(drTotal); @@ -138,6 +140,22 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo dt.Columns.Remove("木薯粉总量"); dt.Columns.Remove("玉米粉总量"); + + for (int j = 0;j <= 4; j++) + { + var dr=dt.Rows[j]; + float total = 0; + for (int i = 1;i <=13;i++) + { + total += Convert.ToSingle(dr[i]); + } + dr[14] = total.ToString("#0.00"); + + + } + + + this.dataGridView.AutoGenerateColumns = true; this.dataGridView.DataSource = null; @@ -169,6 +187,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjReport.DayWhiteEmbryo dt.Columns.Add("炭粉8总量", typeof(string)); dt.Columns.Add("回收总量", typeof(string)); + dt.Columns.Add("总计", typeof(string)); + return dt; } }