فهرست منبع

更新报告导出程序修改颗粒类别后导出不显示的bug

zhangjiaxin 3 ماه پیش
والد
کامیت
81349a906a

+ 49 - 12
OTSIncAReportApp/1-UI/OTSReportExport/Category.cs

@@ -25,16 +25,19 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
         public List<string> vs = new List<string>();
         private bool isRemove = false;
         Hashtable table;
-     
-        public Category(List<string> a_ElementList,DataTable AllList,bool a_Remove)
+        private DataTable ResultLibrary = new DataTable();//测量结果库
+
+
+		public Category(List<string> a_ElementList,DataTable AllList,bool a_Remove,DataTable a_ResultLibrary)
         {
             InitializeComponent();
             ElementList = AllList.Copy();
             CheckTheOptions = a_ElementList.Copy();
             OutElementList = a_ElementList.Copy();
             isRemove = a_Remove;
-            #region 国际化语言
-            OTSCommon.Language lan = new OTSCommon.Language(this);
+            ResultLibrary = a_ResultLibrary.Copy();
+			#region 国际化语言
+			OTSCommon.Language lan = new OTSCommon.Language(this);
             table = lan.GetNameTable(this.Name);
             #endregion
         }
@@ -83,17 +86,45 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
                         }
                         flowLayoutPanel.Controls.Add(box1);
                     }
-                    Panel panel = new Panel();
+
+                    if (ResultLibrary.Rows.Count > 0)
+                    {
+                        for (int i = 0; i < ResultLibrary.Rows.Count; i++)
+                        {
+							// 添加控件到 FlowLayoutPanel 中
+							CheckBox box1 = new CheckBox();
+							box1.Text = ResultLibrary.Rows[i][1].ToString();
+							box1.Width = flowLayoutPanel.Width - 40;
+							box1.Height = 25;
+							Font font = new Font("宋体", 15, FontStyle.Regular);
+							box1.Font = font;
+							if (CheckTheOptions.Count == 0)
+							{
+								if (!isRemove)
+									box1.Checked = true;
+								else
+									box1.Checked = false;
+							}
+							else
+							{
+								for (int a = 0; a < CheckTheOptions.Count; a++)
+								{
+									if (ResultLibrary.Rows[i][0].ToString() == CheckTheOptions[a].ToString())
+										box1.Checked = true;
+								}
+							}
+							flowLayoutPanel.Controls.Add(box1);
+						}
+
+					}
+						Panel panel = new Panel();
                     panel.Size = new Size(10, 10);
                     panel.BackColor = Color.Transparent;
                     flowLayoutPanel.Controls.Add(panel);
 
-
-                    this.checkBox_selall.CheckedChanged -= new System.EventHandler(this.checkBox_selall_CheckedChanged);
-                    checkBox_selall.Checked = true;
-                    this.checkBox_selall.CheckedChanged += new System.EventHandler(this.checkBox_selall_CheckedChanged);
                 }
-            }
+
+			}
 
         }
 
@@ -174,8 +205,14 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
                     vs.Add(ElementList.Rows[i]["STDId"].ToString());
                 }
             }
-
-            IsModify = true;
+			for (int i = 0; i < ResultLibrary.Rows.Count; i++)
+			{
+				if (blList[i])
+				{
+					vs.Add(ResultLibrary.Rows[i][0].ToString());
+				}
+			}
+			IsModify = true;
             this.Close();
         }
         /// <summary>

+ 28 - 8
OTSIncAReportApp/1-UI/OTSReportExport/OTSReport_Template_CleannessA.cs

@@ -4,6 +4,7 @@ using NPOI.Util;
 using OTSCommon.DBOperate;
 using OTSIncAReportApp._1_UI.OTSReportExport;
 using OTSIncAReportApp._1_UI.OTSTemplateDesigner;
+using OTSIncAReportApp.DataOperation.DataAccess;
 using OTSIncAReportApp.OTSSampleReportInfo;
 using OTSIncAReportApp.SysMgrTools;
 using OTSPeriodicTable;
@@ -15,6 +16,7 @@ using System.Data;
 using System.Drawing;
 using System.IO;
 using System.Windows.Forms;
+using static DevExpress.XtraCharts.GLGraphics.GL;
 using static OTSDataType.otsdataconst;
 
 namespace OTSIncAReportApp.OTSTemplateDesigner
@@ -31,11 +33,13 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         private bool SwitchCategories = false;
         private List<string> TCCleannessAList = new List<string>();
         private List<string> list_MainPriority = new List<string>();
-        #endregion
 
-        #region 构造函数及窗体加载
+		ParticleData fielddata;
+		#endregion
+
+		#region 构造函数及窗体加载
 
-        public OTSReport_Template_CleannessA(OTSReport_Export in_otsreport_export,string a_FileName)
+		public OTSReport_Template_CleannessA(OTSReport_Export in_otsreport_export,string a_FileName)
         {
             InitializeComponent();
             m_OTSReport_Export = in_otsreport_export;
@@ -77,9 +81,16 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             {
                 cb_TccleanlinessA.Enabled = true;
             }
-            
 
-        }
+			try
+			{
+				fielddata = new ParticleData(m_OTSReport_Export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_OTSReport_Export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath);
+			}
+			catch
+			{
+
+			}
+		}
 
 
         /// <summary>
@@ -793,12 +804,21 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 {
                     if (textBox_zypxss.Text.Split(',')[i] != "")
                         vs.Add(MainPriority[i]);
-                }
+				}
             }
+			DataTable fieldData = fielddata.GetAreaByAllIncA("");
+            DataTable ResultLibrary = fieldData.Clone();
+            for (int i = 0; i < fieldData.Rows.Count; i++)
+            {
+                if (Convert.ToInt64(fieldData.Rows[i][0]) > 50000)
+                {
+                    ResultLibrary.Rows.Add(fieldData.Rows[i].ItemArray);
 
+				}
+            }
 
-            //Category category = new Category(vs, ReadClassification(comboBox1.SelectedIndex));
-            Category category = new Category(m_OTSReport_Export.m_mbszclass.list_str_MainPriority_Serial.Copy(), ReadClassification(comboBox1.SelectedIndex),false);
+			//Category category = new Category(vs, ReadClassification(comboBox1.SelectedIndex));
+			Category category = new Category(m_OTSReport_Export.m_mbszclass.list_str_MainPriority_Serial.Copy(), ReadClassification(comboBox1.SelectedIndex),false, ResultLibrary);
             category.ShowDialog();
             List<string> ls = category.OutElementList;
             TCCleannessAList = category.vs;

+ 10 - 1
OTSIncAReportApp/1-UI/OTSReportExport/OTSReport_Template_INCA.cs

@@ -869,7 +869,16 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                         data.Rows.Add(dr);
                     }
                 }
-                Category category = new Category(DeleteClass_Serial, data, true);
+				DataTable ResultLibrary = fieldData.Clone();
+				for (int i = 0; i < fieldData.Rows.Count; i++)
+				{
+					if (Convert.ToInt64(fieldData.Rows[i][0]) > 50000)
+					{
+						ResultLibrary.Rows.Add(fieldData.Rows[i].ItemArray);
+
+					}
+				}
+				Category category = new Category(DeleteClass_Serial, data, true, ResultLibrary);
                 category.ShowDialog();
                 if (category.IsModify)
                 {