|
@@ -3247,7 +3247,7 @@ namespace UAS_LabelMachine
|
|
|
if (j == 0)
|
|
|
{
|
|
|
row1.CreateCell(j);
|
|
|
- row1.Cells[j].SetCellValue(DataTable.Columns["pr_orispeccode"].Caption + ":" + DataTable.Rows[i]["pr_orispeccode"].ToString() + " "
|
|
|
+ row1.Cells[j].SetCellValue(DataTable.Columns["pr_orispeccode"].Caption + ":" + DataTable.Rows[i]["pr_orispeccode"].ToString() + "_"
|
|
|
+ "(" + DataTable.Rows[i]["me_desc"].ToString() + ") " + DataTable.Columns["pi_chipouttype"].Caption + ":" + DataTable.Rows[i]["pi_chipouttype"].ToString());
|
|
|
}
|
|
|
else if (j == ShowSizeIndex)
|
|
@@ -3555,7 +3555,7 @@ namespace UAS_LabelMachine
|
|
|
if (j == 0)
|
|
|
{
|
|
|
row1.CreateCell(j);
|
|
|
- row1.Cells[j].SetCellValue(DataTable.Columns["pr_orispeccode"].Caption + ":" + DataTable.Rows[i]["pr_orispeccode"].ToString() + " "
|
|
|
+ row1.Cells[j].SetCellValue(DataTable.Columns["pr_orispeccode"].Caption + ":" + DataTable.Rows[i]["pr_orispeccode"].ToString() + "_"
|
|
|
+ "(" + DataTable.Rows[i]["me_desc"].ToString() + ") " + DataTable.Columns["pi_chipouttype"].Caption + ":" + DataTable.Rows[i]["pi_chipouttype"].ToString());
|
|
|
}
|
|
|
else if (j == ShowSizeIndex)
|
|
@@ -3761,6 +3761,324 @@ namespace UAS_LabelMachine
|
|
|
pib_outboxcode1.Add(BoxCode.ToString());
|
|
|
}
|
|
|
break;
|
|
|
+ case "BoxSplit":
|
|
|
+ string LastBoxCode1 = "";
|
|
|
+ int PageNum2 = 0;
|
|
|
+ string LastBatch = "";
|
|
|
+ for (int i = 0; i < rowNum; i++)
|
|
|
+ {
|
|
|
+ IRow row1 = sheet.CreateRow(PaintIndex);
|
|
|
+ PaintIndex = PaintIndex + 1;
|
|
|
+ row1.HeightInPoints = RowHeight;
|
|
|
+
|
|
|
+ if (LastBoxCode1 != "" && LastBoxCode1 != DataTable.Rows[i]["CH_PBCODE"].ToString())
|
|
|
+ {
|
|
|
+ BoxCode = BoxCode + 1;
|
|
|
+ for (int j = 0; j < ShowColumnCount; j++)
|
|
|
+ {
|
|
|
+ row1.CreateCell(j);
|
|
|
+ if (j == 0)
|
|
|
+ {
|
|
|
+ row1.Cells[j].SetCellValue(批小计);
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ else if (j == ShowPieceIndex)
|
|
|
+ {
|
|
|
+ row1.Cells[ShowPieceIndex].SetCellValue(PageNum2 + 片);
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ else if (j == ShowCountIndex)
|
|
|
+ {
|
|
|
+ row1.Cells[j].SetCellValue(sumCount);
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ else if (j == ShowBoxIndex - 4)
|
|
|
+ {
|
|
|
+ row1.Cells[j].SetCellValue(LastBox);
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ row1 = sheet.CreateRow(PaintIndex);
|
|
|
+ PaintIndex = PaintIndex + 1;
|
|
|
+ for (int j = 0; j < ShowColumnCount; j++)
|
|
|
+ {
|
|
|
+ row1.CreateCell(j);
|
|
|
+ if (j == 0)
|
|
|
+ {
|
|
|
+ row1.Cells[j].SetCellValue(小计);
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ else if (j == ShowPieceIndex)
|
|
|
+ {
|
|
|
+ row1.Cells[ShowPieceIndex].SetCellValue(PageNum2 + 片);
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ else if (j == ShowCountIndex)
|
|
|
+ {
|
|
|
+ row1.Cells[j].SetCellValue(sumCount);
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ else if (j == ShowBoxIndex - 4)
|
|
|
+ {
|
|
|
+ row1.Cells[j].SetCellValue(LastBox);
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sumCount = 0;
|
|
|
+ row1 = sheet.CreateRow(PaintIndex);
|
|
|
+ sheet.SetRowBreak(PaintIndex - 1);
|
|
|
+ sheet.Footer.Center = "第&P页,共&N页";
|
|
|
+ PaintIndex = PaintIndex + 1;
|
|
|
+ PageNum2 = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (LastBoxCode1 == "" || (LastBoxCode1 != "" && LastBoxCode1 != DataTable.Rows[i]["ch_pbcode"].ToString()) || ((i == rowNum - 1) && (LastBoxCode1 != "" && LastBoxCode1 != DataTable.Rows[i]["ch_pbcode"].ToString())))
|
|
|
+ {
|
|
|
+ LastBoxCode1 = DataTable.Rows[i]["CH_PBCODE"].ToString();
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ for (int j = 0; j < columnNum - 3; j++)
|
|
|
+ {
|
|
|
+ if (j == 0)
|
|
|
+ {
|
|
|
+ row1.CreateCell(j);
|
|
|
+ row1.Cells[j].SetCellValue(DataTable.Columns["pi_title"].Caption + ":" + DataTable.Rows[i]["pi_title"].ToString() + " "
|
|
|
+ + DataTable.Columns["ch_level"].Caption + ":" + DataTable.Rows[i]["ch_level"].ToString());
|
|
|
+ }
|
|
|
+ else if (j == ShowDataIndex)
|
|
|
+ {
|
|
|
+ row1.CreateCell(j);
|
|
|
+ row1.Cells[j].SetCellValue(DataTable.Columns["pi_inoutno"].Caption + ":" + DataTable.Rows[i]["pi_inoutno"].ToString());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ row1.CreateCell(j);
|
|
|
+ }
|
|
|
+ row1.GetCell(j).CellStyle = style;
|
|
|
+ }
|
|
|
+ row1 = sheet.CreateRow(PaintIndex);
|
|
|
+ PaintIndex = PaintIndex + 1;
|
|
|
+
|
|
|
+ for (int j = 0; j < columnNum - 3; j++)
|
|
|
+ {
|
|
|
+ if (j == 0)
|
|
|
+ {
|
|
|
+ row1.CreateCell(j);
|
|
|
+ row1.Cells[j].SetCellValue(DataTable.Columns["pr_orispeccode"].Caption + ":" + DataTable.Rows[i]["pr_orispeccode"].ToString() + "_"
|
|
|
+ + "(" + DataTable.Rows[i]["me_desc"].ToString() + ") " + DataTable.Columns["pi_chipouttype"].Caption + ":" + DataTable.Rows[i]["pi_chipouttype"].ToString());
|
|
|
+ }
|
|
|
+ else if (j == ShowSizeIndex)
|
|
|
+ {
|
|
|
+ row1.CreateCell(j);
|
|
|
+ row1.Cells[j].SetCellValue(DataTable.Columns["pr_size"].Caption + ":" + DataTable.Rows[i]["pr_size"].ToString());
|
|
|
+ }
|
|
|
+ else if (j == ShowDataIndex)
|
|
|
+ {
|
|
|
+ row1.CreateCell(j);
|
|
|
+ row1.Cells[j].SetCellValue(DataTable.Columns["pi_date"].Caption + ":" + DataTable.Rows[i]["pi_date"].ToString());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ row1.CreateCell(j);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ row1 = sheet.CreateRow(PaintIndex);
|
|
|
+ PaintIndex = PaintIndex + 1;
|
|
|
+ int showcount = 0;
|
|
|
+ for (int j = 4; j < columnNum; j++)
|
|
|
+ {
|
|
|
+ if (DataTable.Columns[j].ColumnName.ToLower() == "chw_percent1")
|
|
|
+ {
|
|
|
+ showcount = showcount + 1;
|
|
|
+ row1.CreateCell(j - 4);
|
|
|
+ row1.Cells[j - 4].CellStyle = ColumnTitleStyle;
|
|
|
+ row1.Cells[j - 4].SetCellValue(DataTable.Rows[i]["chw_itemname1"].ToString());
|
|
|
+ }
|
|
|
+ else if (DataTable.Columns[j].ColumnName.ToLower() == "chw_percent2")
|
|
|
+ {
|
|
|
+ showcount = showcount + 1;
|
|
|
+ row1.CreateCell(j - 4);
|
|
|
+ row1.Cells[j - 4].CellStyle = ColumnTitleStyle;
|
|
|
+ row1.Cells[j - 4].SetCellValue(DataTable.Rows[i]["chw_itemname2"].ToString());
|
|
|
+ }
|
|
|
+ else if (DataTable.Columns[j].ColumnName.ToLower() == "chw_percent3")
|
|
|
+ {
|
|
|
+ showcount = showcount + 1;
|
|
|
+ row1.CreateCell(j - 4);
|
|
|
+ row1.Cells[j - 4].CellStyle = ColumnTitleStyle;
|
|
|
+ row1.Cells[j - 4].SetCellValue(DataTable.Rows[i]["chw_itemname3"].ToString());
|
|
|
+ }
|
|
|
+ else if ((NotShowColumn.Contains(DataTable.Columns[j].ColumnName.ToLower())))
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ showcount = showcount + 1;
|
|
|
+ row1.CreateCell(j - 4);
|
|
|
+ row1.Cells[j - 4].CellStyle = ColumnTitleStyle;
|
|
|
+ row1.Cells[j - 4].SetCellValue(DataTable.Columns[j].Caption);
|
|
|
+ }
|
|
|
+ if (DataTable.Columns[j].ColumnName.ToLower().ToString() == "ch_pbcode")
|
|
|
+ {
|
|
|
+ ShowBoxIndex = j;
|
|
|
+ }
|
|
|
+ if (DataTable.Columns[j].ColumnName.ToString() == "io_qty")
|
|
|
+ {
|
|
|
+ NumIndex = j;
|
|
|
+ if (ShowCountIndex == NumIndex - 4)
|
|
|
+ {
|
|
|
+ ShowCountIndex = ShowCountIndex + 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ShowColumnCount = showcount;
|
|
|
+ row1 = sheet.CreateRow(PaintIndex);
|
|
|
+ PaintIndex = PaintIndex + 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int j = 4; j < columnNum; j++)
|
|
|
+ {
|
|
|
+ string Data = DataTable.Rows[i][j].ToString();
|
|
|
+ row1.CreateCell(j - 4);
|
|
|
+ if ((NotShowColumn.Contains(DataTable.Columns[j].ColumnName.ToLower())))
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ row1.Cells[j - 4].SetCellValue(Data);
|
|
|
+ row1.GetCell(j - 4).CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ if (DataTable.Columns[j].ColumnName == "io_qty")
|
|
|
+ {
|
|
|
+ row1.Cells[j - 4].SetCellValue(int.Parse(Data));
|
|
|
+ sumCount += int.Parse(DataTable.Rows[i][j].ToString());
|
|
|
+ totalCount += int.Parse(DataTable.Rows[i][j].ToString());
|
|
|
+ }
|
|
|
+ if (DataTable.Columns[j].ColumnName == "rownum")
|
|
|
+ {
|
|
|
+ row1.Cells[j - 4].SetCellValue(i + 1);
|
|
|
+ }
|
|
|
+ if (DataTable.Columns[j].ColumnName == "ch_code")
|
|
|
+ {
|
|
|
+ sheet.AutoSizeColumn(j - 4);
|
|
|
+ sheet.SetColumnWidth(j - 4, sheet.GetColumnWidth(j - 4) + 1000);
|
|
|
+ }
|
|
|
+ if (DataTable.Columns[j].ColumnName.ToLower() == "ch_pbcode")
|
|
|
+ {
|
|
|
+ LastBox = Data;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (i == rowNum - 1)
|
|
|
+ {
|
|
|
+ PageNum2 = PageNum2 + 1;
|
|
|
+ row1 = sheet.CreateRow(PaintIndex);
|
|
|
+ PaintIndex = PaintIndex + 1;
|
|
|
+ for (int j = 0; j < ShowColumnCount; j++)
|
|
|
+ {
|
|
|
+ row1.CreateCell(j);
|
|
|
+ if (j == 0)
|
|
|
+ {
|
|
|
+ row1.Cells[j].SetCellValue(批小计);
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ else if (j == ShowPieceIndex)
|
|
|
+ {
|
|
|
+ row1.Cells[ShowPieceIndex].SetCellValue(PageNum2 + 片);
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ else if (j == ShowCountIndex)
|
|
|
+ {
|
|
|
+ row1.Cells[j].SetCellValue(sumCount);
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ else if (j == ShowBoxIndex - 4)
|
|
|
+ {
|
|
|
+ row1.Cells[j].SetCellValue(LastBox);
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ row1 = sheet.CreateRow(PaintIndex);
|
|
|
+ PaintIndex = PaintIndex + 1;
|
|
|
+ for (int j = 0; j < ShowColumnCount; j++)
|
|
|
+ {
|
|
|
+ row1.CreateCell(j);
|
|
|
+ if (j == 0)
|
|
|
+ {
|
|
|
+ row1.Cells[j].SetCellValue(小计);
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ else if (j == ShowPieceIndex)
|
|
|
+ {
|
|
|
+ row1.Cells[ShowPieceIndex].SetCellValue(PageNum2 + 片);
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ else if (j == ShowCountIndex)
|
|
|
+ {
|
|
|
+ row1.Cells[j].SetCellValue(sumCount);
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ else if (j == ShowBoxIndex - 4)
|
|
|
+ {
|
|
|
+ row1.Cells[j].SetCellValue(LastBox);
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ row1.Cells[j].CellStyle = styleborder;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ row1 = sheet.CreateRow(PaintIndex);
|
|
|
+
|
|
|
+ for (int j = 0; j < columnNum - 3; j++)
|
|
|
+ {
|
|
|
+ if (j == 0)
|
|
|
+ {
|
|
|
+ row1.CreateCell(j);
|
|
|
+ row1.Cells[j].SetCellValue("备注");
|
|
|
+ }
|
|
|
+ else if (j == ShowCountIndex)
|
|
|
+ {
|
|
|
+ row1.CreateCell(j);
|
|
|
+ row1.Cells[j].SetCellValue(totalCount);
|
|
|
+ }
|
|
|
+ else if (j == ShowRemarkPiece)
|
|
|
+ {
|
|
|
+ row1.CreateCell(j);
|
|
|
+ row1.Cells[j].SetCellValue(rowNum + 片);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ row1.CreateCell(j);
|
|
|
+ }
|
|
|
+ row1.Cells[j].CellStyle = style;
|
|
|
+ }
|
|
|
+ sheet.SetRowBreak(PaintIndex);
|
|
|
+ sheet.Footer.Center = "第&P页,共&N页";
|
|
|
+ PaintIndex = PaintIndex + 1;
|
|
|
+ PageNum1 = 0;
|
|
|
+ }
|
|
|
+ PageNum2 = PageNum2 + 1;
|
|
|
+ pib_id.Add(DataTable.Rows[i]["pib_id"].ToString());
|
|
|
+ pib_outboxcode1.Add(BoxCode.ToString());
|
|
|
+ }
|
|
|
+ break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|