瀏覽代碼

外箱打印BUG

章政 7 年之前
父節點
當前提交
f445a1bc2a
共有 1 個文件被更改,包括 5 次插入28 次删除
  1. 5 28
      UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

+ 5 - 28
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -969,34 +969,11 @@ namespace UAS_LabelMachine
                 }
                 string pib_outboxcode2 = LabelInf.Rows[rowindex].Cells["pib_outboxcode2"].Value.ToString();
                 DataTable dt = (DataTable)dh.ExecuteSql("select * from prodiooutinfo_view where 出货单号='" + pi_inoutno.Text + "' and 外箱号='" + pib_outboxcode2 + "'", "select");
-                DataTable dt1 = dt.Clone();
-                for (int i = 0; i < dt.Rows.Count; i++)
-                {
-                    DataRow dr = dt1.NewRow();
-                    for (int j = 0; j < dt.Columns.Count; j++)
-                    {
-                        dr[j] = dt.Rows[i][j].ToString();
-                    }
-                    dt1.Rows.Add(dr);
-                    if ((i + 1) % 5 == 0 || (i + 1) == dt.Rows.Count)
-                    {
-                        OutReport.RegisterData(dt1, "prodiooutinfo_view");
-                        OutReport.GetDataSource("prodiooutinfo_view").Enabled = true;
-                        OutReport.PrintSettings.ShowDialog = false;
-                        OutReport.PrintSettings.Printer = OutBoxPrinter.Text;
-                     
-                        try
-                        {
-                            OutReport.Show();
-                        }
-                        catch (Exception e)
-                        {
-                            MessageBox.Show(e.Message);
-                            return;
-                        }
-                        BaseUtil.CleanDataTableData(dt1);
-                    }
-                }
+                OutReport.RegisterData(dt, "prodiooutinfo_view");
+                OutReport.GetDataSource("prodiooutinfo_view").Enabled = true;
+                OutReport.PrintSettings.ShowDialog = false;
+                OutReport.PrintSettings.Printer = OutBoxPrinter.Text;
+                OutReport.Print();
                 Properties.Settings.Default.OPrinter = OutBoxPrinter.Text;
                 Properties.Settings.Default.Save();
             }