|
|
@@ -349,6 +349,7 @@ namespace UAS_LabelMachine
|
|
|
string 总计 = "";
|
|
|
string 片 = "";
|
|
|
string companyname = "";
|
|
|
+ Dictionary<int, double> PercentSum = new Dictionary<int, double>();
|
|
|
if (dh.getFieldDataByCondition("ProdInout", "pi_exporttype", "pi_inoutno='" + Inoutno + "'").ToString() == "Chinese")
|
|
|
{
|
|
|
小计 = "小计";
|
|
|
@@ -361,6 +362,11 @@ namespace UAS_LabelMachine
|
|
|
总计 = "total";
|
|
|
companyname = "SHENZHEN SI SEMICONDUCTORS CO.,LTD";
|
|
|
}
|
|
|
+ bool CountQty = false;
|
|
|
+ if (dh.getFieldDataByCondition("ProdInout", "pi_exporttype1", "pi_inoutno='" + Inoutno + "'").ToString() == "QTY")
|
|
|
+ {
|
|
|
+ CountQty = true;
|
|
|
+ }
|
|
|
//转换为序列
|
|
|
CheckBox[] box = conditionbox.ToArray();
|
|
|
//创建内存流
|
|
|
@@ -586,6 +592,16 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
row1.Cells[j].SetCellValue(sumCount);
|
|
|
}
|
|
|
+ if (CountQty)
|
|
|
+ {
|
|
|
+ for (int k = 0; k < PercentSum.Count; k++)
|
|
|
+ {
|
|
|
+ if (PercentSum.ContainsKey(j))
|
|
|
+ {
|
|
|
+ row1.Cells[j].SetCellValue(PercentSum[j]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
row1.Cells[j].CellStyle = styleborder;
|
|
|
}
|
|
|
sumCount = 0;
|
|
|
@@ -647,6 +663,7 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
if (DataTable.Columns[j].ColumnName.ToLower() == "chw_percent1")
|
|
|
{
|
|
|
+ PercentSum.Add(j - 4, 0);
|
|
|
showcount = showcount + 1;
|
|
|
row1.CreateCell(j - 4);
|
|
|
row1.Cells[j - 4].CellStyle = ColumnTitleStyle;
|
|
|
@@ -654,6 +671,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
else if (DataTable.Columns[j].ColumnName.ToLower() == "chw_percent2")
|
|
|
{
|
|
|
+ PercentSum.Add(j - 4, 0);
|
|
|
showcount = showcount + 1;
|
|
|
row1.CreateCell(j - 4);
|
|
|
row1.Cells[j - 4].CellStyle = ColumnTitleStyle;
|
|
|
@@ -661,6 +679,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
else if (DataTable.Columns[j].ColumnName.ToLower() == "chw_percent3")
|
|
|
{
|
|
|
+ PercentSum.Add(j - 4, 0);
|
|
|
showcount = showcount + 1;
|
|
|
row1.CreateCell(j - 4);
|
|
|
row1.Cells[j - 4].CellStyle = ColumnTitleStyle;
|
|
|
@@ -668,6 +687,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
else if (DataTable.Columns[j].ColumnName.ToLower() == "chw_percent4")
|
|
|
{
|
|
|
+ PercentSum.Add(j - 4, 0);
|
|
|
showcount = showcount + 1;
|
|
|
row1.CreateCell(j - 4);
|
|
|
row1.Cells[j - 4].CellStyle = ColumnTitleStyle;
|
|
|
@@ -675,6 +695,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
else if (DataTable.Columns[j].ColumnName.ToLower() == "chw_percent5")
|
|
|
{
|
|
|
+ PercentSum.Add(j - 4, 0);
|
|
|
showcount = showcount + 1;
|
|
|
row1.CreateCell(j - 4);
|
|
|
row1.Cells[j - 4].CellStyle = ColumnTitleStyle;
|
|
|
@@ -724,6 +745,13 @@ namespace UAS_LabelMachine
|
|
|
if (double.TryParse(Data, out Num))
|
|
|
{
|
|
|
row1.Cells[j - 4].SetCellValue(Num);
|
|
|
+ for (int k = 0; k < PercentSum.Count; k++)
|
|
|
+ {
|
|
|
+ if (PercentSum.ContainsKey(j - 4))
|
|
|
+ {
|
|
|
+ PercentSum[j - 4] += Num;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -784,7 +812,16 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
row1.Cells[j].SetCellValue(sumCount);
|
|
|
}
|
|
|
-
|
|
|
+ if (CountQty)
|
|
|
+ {
|
|
|
+ for (int k = 0; k < PercentSum.Count; k++)
|
|
|
+ {
|
|
|
+ if (PercentSum.ContainsKey(j))
|
|
|
+ {
|
|
|
+ row1.Cells[j].SetCellValue(PercentSum[j]/PercentSum.Count);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
row1.Cells[j].CellStyle = styleborder;
|
|
|
}
|
|
|
row1 = sheet.CreateRow(PaintIndex);
|