Browse Source

调整参数空指针异常

章政 7 years ago
parent
commit
bf092ae205

+ 0 - 1
UAS-出货标签管理(泽天)/UAS_出货标签管理.Designer.cs

@@ -258,7 +258,6 @@
             this.GetGridOnly.TabIndex = 82;
             this.GetGridOnly.Text = "仅获取表格";
             this.GetGridOnly.UseVisualStyleBackColor = true;
-            this.GetGridOnly.Visible = false;
             // 
             // dataGridViewCheckBoxColumn1
             // 

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

@@ -389,9 +389,10 @@ namespace UAS_LabelMachine
                 StringBuilder ParamLog = new StringBuilder();
                 for (int i = 0; i < PIBID.Length; i++)
                 {
-                    for (int k = 0; k < Attach.Rows.Count; k++)
+                    for (int j = 0; j < SingleReport.Parameters.Count; j++)
                     {
-                        for (int j = 0; j < SingleReport.Parameters.Count; j++)
+                        SingleReport.SetParameterValue(SingleReport.Parameters[j].Name, "");
+                        for (int k = 0; k < Attach.Rows.Count; k++)
                         {
                             if (Attach.Rows[k][0].ToString() == SingleReport.Parameters[j].Name)
                             {
@@ -603,9 +604,10 @@ namespace UAS_LabelMachine
                         //勾选了并且未打印
                         if (LabelInf.Rows[i].Cells["Choose"].FormattedValue.ToString().ToLower() == "true" && LabelInf.Rows[i].Cells["pib_ifprint"].FormattedValue.ToString().ToLower() != "true")
                         {
-                            for (int k = 0; k < Attach.Rows.Count; k++)
+                            for (int j = 0; j < SingleReport.Parameters.Count; j++)
                             {
-                                for (int j = 0; j < SingleReport.Parameters.Count; j++)
+                                SingleReport.SetParameterValue(SingleReport.Parameters[j].Name, "");
+                                for (int k = 0; k < Attach.Rows.Count; k++)
                                 {
                                     if (Attach.Rows[k][0].ToString() == SingleReport.Parameters[j].Name)
                                     {
@@ -877,9 +879,10 @@ namespace UAS_LabelMachine
         {
             if (EnablePrint)
             {
-                for (int i = 0; i < Attach.Rows.Count; i++)
+                for (int j = 0; j < MidReport.Parameters.Count; j++)
                 {
-                    for (int j = 0; j < MidReport.Parameters.Count; j++)
+                    MidReport.SetParameterValue(MidReport.Parameters[j].Name, "");
+                    for (int i = 0; i < Attach.Rows.Count; i++)
                     {
                         if (Attach.Rows[i][0].ToString() == MidReport.Parameters[j].Name)
                         {
@@ -908,9 +911,10 @@ namespace UAS_LabelMachine
         {
             if (EnablePrint)
             {
-                for (int i = 0; i < Attach.Rows.Count; i++)
+                for (int j = 0; j < OutReport.Parameters.Count; j++)
                 {
-                    for (int j = 0; j < OutReport.Parameters.Count; j++)
+                    OutReport.SetParameterValue(OutReport.Parameters[j].Name, "");
+                    for (int i = 0; i < Attach.Rows.Count; i++)
                     {
                         if (Attach.Rows[i][0].ToString() == OutReport.Parameters[j].Name)
                         {