Explorar o código

导出优化清洁度设置页面,导出元素分析表BUG修正

zhangjiaxin hai 2 meses
pai
achega
8a45e328f3

+ 2 - 2
Bin/x64/Debug/Config/ReportTemplate/TCleannessA_Template/ReportTemplateConfig.xml

@@ -144,10 +144,10 @@
   <whole>
     <list_str_MainPriority>System.Collections.Generic.List`1[System.String]<YS0>Cu alloy</YS0><YS1>Cu(Zn)</YS1><YS2>Zn alloy</YS2><YS3>Fe-Cr-Ni</YS3><YS4>Fe-Cr</YS4><YS5>Fe-Ni</YS5><YS6>Fe-O</YS6><YS7>Cu-O</YS7><YS8>Zn-O</YS8><YS9>Nialloy</YS9><YS10>Ni-Cr</YS10><YS11>Fe-NCM </YS11><YS12>Fe-P</YS12><YS13>Fe-alloy</YS13><YS14>Cr-alloy</YS14><YS15>NCM</YS15><YS16>W-alloy</YS16><YS17>Zr alloy</YS17><YS18>Ti alloy</YS18><YS19>Al alloy</YS19><YS20>Al-0</YS20><YS21>Ca-Mg-Na-K-Si</YS21><YS22>NoFerous Mental</YS22></list_str_MainPriority>
     <list_str_SecondaryPriority>System.Collections.Generic.List`1[System.String]<YS0>Nialloy</YS0><YS1>Fe-O</YS1><YS2>Fe-Cr</YS2><YS3>Fe-alloy</YS3></list_str_SecondaryPriority>
-    <str_MainPriority>Ferrous:Fe-Cr-Ni , Ferrous:Fe-Ni , Ferrous:Fe-NCM  , Default:Nialloy , Default:Ni-Cr , Default:Fe-alloy , Default:Cr-alloy , Default:NCM , Default:W-alloy , Default:Zr alloy , Default:Ti alloy , Default:Al alloy , Default:Al-0 , Default:Ca-Mg-Na-K-Si , Default:NoFerous Mental , Default:misc</str_MainPriority>
+    <str_MainPriority>Ferrous:Fe-P , Ferrous:Fe-Cr-Ni , Ferrous:Fe-Cr , Ferrous:Fe-Ni , Ferrous:Fe-O , Ferrous:Fe-NCM  , Default:Nialloy , Default:Ni-Cr , Default:Fe-alloy , Default:Cr-alloy , Default:NCM , Default:W-alloy , Default:Zr alloy , Default:Ti alloy , Default:Al alloy , Default:Al-0 , Default:Ca-Mg-Na-K-Si , Default:NoFerous Mental , Default:misc</str_MainPriority>
     <str_SecondaryPriority>Nialloy,Fe-O,Fe-Cr,Fe-alloy</str_SecondaryPriority>
     <list_str_MainPriority_Serial>System.Collections.Generic.List`1[System.String]<YS0>40003</YS0><YS1>40004</YS1><YS2>40005</YS2><YS3>40006</YS3><YS4>40007</YS4><YS5>40008</YS5><YS6>40001</YS6><YS7>40002</YS7><YS8>40009</YS8><YS9>40010</YS9><YS10>40011</YS10><YS11>40012</YS11><YS12>40013</YS12><YS13>40014</YS13><YS14>40015</YS14><YS15>40016</YS15><YS16>40017</YS16><YS17>40018</YS17><YS18>40019</YS18><YS19>40020</YS19><YS20>40021</YS20><YS21>40022</YS21><YS22>40024</YS22></list_str_MainPriority_Serial>
-    <str_MainPriorityID>2:40006 , 2:40008 , 2:40012 , 0:40010 , 0:40011 , 0:40014 , 0:40015 , 0:40016 , 0:40017 , 0:40018 , 0:40019 , 0:40020 , 0:40021 , 0:40022 , 0:40024 , 0:40025</str_MainPriorityID>
+    <str_MainPriorityID>2:40013 , 2:40006 , 2:40007 , 2:40008 , 2:40001 , 2:40012 , 0:40010 , 0:40011 , 0:40014 , 0:40015 , 0:40016 , 0:40017 , 0:40018 , 0:40019 , 0:40020 , 0:40021 , 0:40022 , 0:40024 , 0:40025</str_MainPriorityID>
   </whole>
   <M_DZ>
     <Notes>

+ 1 - 1
OTSIncAReportApp/1-UI/OTSReportExport/Cleanness/OTSReport_Template_CleannessA.Designer.cs

@@ -675,7 +675,7 @@
 			this.button8.Name = "button8";
 			this.button8.Size = new System.Drawing.Size(75, 23);
 			this.button8.TabIndex = 71;
-			this.button8.Text = "button8";
+			this.button8.Text = "规则选择";
 			this.button8.UseVisualStyleBackColor = true;
 			this.button8.Click += new System.EventHandler(this.button8_Click);
 			// 

+ 29 - 15
OTSIncAReportApp/1-UI/OTSReportExport/RuleGroupSelector.Designer.cs

@@ -29,15 +29,17 @@
 		private void InitializeComponent()
 		{
 			this.panel1 = new System.Windows.Forms.Panel();
+			this.checkBox1 = new System.Windows.Forms.CheckBox();
 			this.button2 = new System.Windows.Forms.Button();
 			this.button1 = new System.Windows.Forms.Button();
 			this.checkedListBox1 = new System.Windows.Forms.CheckedListBox();
-			this.checkBox1 = new System.Windows.Forms.CheckBox();
+			this.checkedListBox2 = new System.Windows.Forms.CheckedListBox();
 			this.panel1.SuspendLayout();
 			this.SuspendLayout();
 			// 
 			// panel1
 			// 
+			this.panel1.Controls.Add(this.checkedListBox2);
 			this.panel1.Controls.Add(this.checkBox1);
 			this.panel1.Controls.Add(this.button2);
 			this.panel1.Controls.Add(this.button1);
@@ -45,12 +47,23 @@
 			this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
 			this.panel1.Location = new System.Drawing.Point(0, 0);
 			this.panel1.Name = "panel1";
-			this.panel1.Size = new System.Drawing.Size(233, 345);
+			this.panel1.Size = new System.Drawing.Size(471, 432);
 			this.panel1.TabIndex = 0;
 			// 
+			// checkBox1
+			// 
+			this.checkBox1.AutoSize = true;
+			this.checkBox1.Location = new System.Drawing.Point(8, 404);
+			this.checkBox1.Name = "checkBox1";
+			this.checkBox1.Size = new System.Drawing.Size(48, 16);
+			this.checkBox1.TabIndex = 6;
+			this.checkBox1.Text = "全选";
+			this.checkBox1.UseVisualStyleBackColor = true;
+			this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
+			// 
 			// button2
 			// 
-			this.button2.Location = new System.Drawing.Point(149, 320);
+			this.button2.Location = new System.Drawing.Point(236, 398);
 			this.button2.Name = "button2";
 			this.button2.Size = new System.Drawing.Size(81, 22);
 			this.button2.TabIndex = 3;
@@ -60,7 +73,7 @@
 			// 
 			// button1
 			// 
-			this.button1.Location = new System.Drawing.Point(62, 320);
+			this.button1.Location = new System.Drawing.Point(149, 397);
 			this.button1.Name = "button1";
 			this.button1.Size = new System.Drawing.Size(81, 22);
 			this.button1.TabIndex = 2;
@@ -73,25 +86,25 @@
 			this.checkedListBox1.FormattingEnabled = true;
 			this.checkedListBox1.Location = new System.Drawing.Point(3, 3);
 			this.checkedListBox1.Name = "checkedListBox1";
-			this.checkedListBox1.Size = new System.Drawing.Size(227, 308);
+			this.checkedListBox1.Size = new System.Drawing.Size(227, 388);
 			this.checkedListBox1.TabIndex = 1;
+			this.checkedListBox1.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.checkedListBox1_ItemCheck);
+			this.checkedListBox1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.checkedListBox1_MouseClick);
 			// 
-			// checkBox1
+			// checkedListBox2
 			// 
-			this.checkBox1.AutoSize = true;
-			this.checkBox1.Location = new System.Drawing.Point(8, 324);
-			this.checkBox1.Name = "checkBox1";
-			this.checkBox1.Size = new System.Drawing.Size(48, 16);
-			this.checkBox1.TabIndex = 6;
-			this.checkBox1.Text = "全选";
-			this.checkBox1.UseVisualStyleBackColor = true;
-			this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
+			this.checkedListBox2.FormattingEnabled = true;
+			this.checkedListBox2.Location = new System.Drawing.Point(236, 3);
+			this.checkedListBox2.Name = "checkedListBox2";
+			this.checkedListBox2.Size = new System.Drawing.Size(227, 388);
+			this.checkedListBox2.TabIndex = 7;
+			this.checkedListBox2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.checkedListBox2_MouseDown);
 			// 
 			// RuleGroupSelector
 			// 
 			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
 			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-			this.ClientSize = new System.Drawing.Size(233, 345);
+			this.ClientSize = new System.Drawing.Size(471, 432);
 			this.Controls.Add(this.panel1);
 			this.MaximizeBox = false;
 			this.MinimizeBox = false;
@@ -112,5 +125,6 @@
 		private System.Windows.Forms.Button button2;
 		private System.Windows.Forms.Button button1;
 		private System.Windows.Forms.CheckBox checkBox1;
+		private System.Windows.Forms.CheckedListBox checkedListBox2;
 	}
 }

+ 155 - 24
OTSIncAReportApp/1-UI/OTSReportExport/RuleGroupSelector.cs

@@ -21,6 +21,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
 		private ContextMenuStrip contextMenuStrip1;
 		public DataTable dt;
 		public List<DataTable> List_RuleTable;
+		//private DataTable RuleData = new DataTable();
 		int listIndex = -1;
 		public RuleGroupSelector(DataTable a_dataTable, List<DataTable> a_List_RuleTable)
         {
@@ -51,15 +52,15 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
 			}
 
 
-			//创建右键菜单
+			////创建右键菜单
 
-			contextMenuStrip1 = new ContextMenuStrip();
-			ToolStripMenuItem deleteItem = new ToolStripMenuItem("规则设置");
-			deleteItem.Click += RuleSettingSelection;
-			contextMenuStrip1.Items.Add(deleteItem);
+			//contextMenuStrip1 = new ContextMenuStrip();
+			//ToolStripMenuItem deleteItem = new ToolStripMenuItem("规则设置");
+			//deleteItem.Click += RuleSettingSelection;
+			//contextMenuStrip1.Items.Add(deleteItem);
 
-			// 订阅鼠标按下事件(控制菜单弹出逻辑)
-			checkedListBox1.MouseDown += checkedListBox1_MouseDown;
+			//// 订阅鼠标按下事件(控制菜单弹出逻辑)
+			//checkedListBox1.MouseDown += checkedListBox1_MouseDown;
 		}
 		private void RuleSettingSelection(object sender, EventArgs e)
 		{
@@ -79,26 +80,38 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
 		}
 		private void checkedListBox1_MouseDown(object sender, MouseEventArgs e)
 		{
-			if (e.Button == MouseButtons.Right)
+			if (e.Button == MouseButtons.Left)
 			{
 				// 获取点击位置的项索引
 				int index = checkedListBox1.IndexFromPoint(e.Location);
-				//Thread.Sleep(500);
 				listIndex = index;
-				if (index != ListBox.NoMatches) // 确保点击的是有效项
-				{
-					// 切换选中状态
-					bool isChecked = checkedListBox1.GetItemChecked(index);
-					checkedListBox1.SetItemChecked(index, !isChecked);
-					contextMenuStrip1.Show(checkedListBox1, e.Location);
-				}
-				else
+				if (index == -1)
+				{ return; }
+
+				for (int i = 0; i < List_RuleTable.Count; i++)
 				{
-					checkedListBox1.SelectedIndex = -1; // 取消选中
-					contextMenuStrip1.Hide();// 点击空白区域时不显示菜单
+					if (dt.Rows[i]["GroupId"].ToString() == List_RuleTable[listIndex].TableName.ToString())
+					{
+						checkedListBox2.Items.Clear();
+						for (int a = 0; a < List_RuleTable[listIndex].Rows.Count; a++)
+						{
+							checkedListBox2.Items.Add(List_RuleTable[listIndex].Rows[a]["StrName"]);
+						}
+
+						for (int a = 0; a < List_RuleTable[listIndex].Rows.Count; a++)
+						{
+							if (List_RuleTable[listIndex].Rows[a]["display"].ToString() == "0")
+							{
+								checkedListBox2.SetItemChecked(a, false);
+							}
+							else
+							{
+								checkedListBox2.SetItemChecked(a, true);
+							}
+						}
+					}
 				}
 			}
-			
 		}
 
 		private void button2_Click(object sender, EventArgs e)
@@ -124,13 +137,131 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
 
 		private void checkBox1_CheckedChanged(object sender, EventArgs e)
 		{
-			CheckBox checkBox = sender as CheckBox;
+			//CheckBox checkBox = sender as CheckBox;
 
-			// 根据CheckBox的状态设置CheckedListBox的所有项
-			for (int i = 0; i < checkedListBox1.Items.Count; i++)
+			//// 根据CheckBox的状态设置CheckedListBox的所有项
+			//for (int i = 0; i < checkedListBox1.Items.Count; i++)
+			//{
+			//	checkedListBox1.SetItemChecked(i, checkBox.Checked);
+			//}
+
+			if (checkBox1.Checked)
+			{
+				for (int i = 0; i < List_RuleTable.Count; i++)
+				{
+					for (int a = 0; a < List_RuleTable[i].Rows.Count; a++)
+					{
+						List_RuleTable[i].Rows[a]["display"] = "1";
+					}
+				}
+
+				for (int i = 0; i < checkedListBox1.Items.Count; i++)
+				{
+					checkedListBox1.SetItemChecked(i, true);
+				}
+				for (int i = 0; i < checkedListBox2.Items.Count; i++)
+				{
+					checkedListBox2.SetItemChecked(i, true);
+				}
+			}
+			else
 			{
-				checkedListBox1.SetItemChecked(i, checkBox.Checked);
+				for (int i = 0; i < List_RuleTable.Count; i++)
+				{
+					for (int a = 0; a < List_RuleTable[i].Rows.Count; a++)
+					{
+						List_RuleTable[i].Rows[a]["display"] = "0";
+					}
+				}
+
+				for (int i = 0; i < checkedListBox1.Items.Count; i++)
+				{
+					checkedListBox1.SetItemChecked(i, false);
+				}
+				for (int i = 0; i < checkedListBox2.Items.Count; i++)
+				{
+					checkedListBox2.SetItemChecked(i, false);
+				}
+
 			}
+
+			
+
+		}
+
+		private void checkedListBox1_MouseClick(object sender, MouseEventArgs e)
+		{
+
+		}
+
+		private void checkedListBox2_MouseDown(object sender, MouseEventArgs e)
+		{
+			if (e.Button == MouseButtons.Left)
+			{
+				// 获取点击位置的项索引
+				int index = checkedListBox1.IndexFromPoint(e.Location);
+				if (index == -1)
+					return;
+
+				for (int i = 0; i < List_RuleTable[listIndex].Rows.Count; i++)
+				{
+					if (checkedListBox1.GetItemChecked(index))
+					{
+						List_RuleTable[listIndex].Rows[i]["display"] = "1";
+					}
+					else
+					{
+						List_RuleTable[listIndex].Rows[i]["display"] = "0";
+					}
+
+				}
+
+			}
+		}
+
+		private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
+		{
+			// 获取当前操作的条目索引
+			int index = e.Index;
+			if(index==-1)
+				return;
+			if (listIndex == -1)
+				return;
+			if (!checkedListBox1.GetItemChecked(index))
+			{
+				for (int i = 0; i < List_RuleTable[listIndex].Rows.Count; i++)
+				{
+					checkedListBox2.Items.Clear();
+					for (int a = 0; a < List_RuleTable[listIndex].Rows.Count; a++)
+					{
+						checkedListBox2.Items.Add(List_RuleTable[listIndex].Rows[a]["StrName"]);
+					}
+
+					for (int a = 0; a < List_RuleTable[listIndex].Rows.Count; a++)
+					{
+						List_RuleTable[listIndex].Rows[a]["display"] = "1";
+						checkedListBox2.SetItemChecked(a, true);
+					}
+				}
+			}
+			else
+			{
+				for (int i = 0; i < List_RuleTable[listIndex].Rows.Count; i++)
+				{
+					checkedListBox2.Items.Clear();
+					for (int a = 0; a < List_RuleTable[listIndex].Rows.Count; a++)
+					{
+						checkedListBox2.Items.Add(List_RuleTable[listIndex].Rows[a]["StrName"]);
+					}
+
+					for (int a = 0; a < List_RuleTable[listIndex].Rows.Count; a++)
+					{
+						List_RuleTable[listIndex].Rows[a]["display"] = "0";
+						checkedListBox2.SetItemChecked(a, false);
+					}
+				}
+			}
+			
 		}
 	}
 }

+ 43 - 34
OTSIncAReportApp/1-UI/OTSReportExport/Template/DataTemplate.cs

@@ -1916,21 +1916,21 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
         private void add_SetElementAvgGridS(List<DataTable> a_datas)
         {
             XRTable xRTable = add_ElementListS();
-            setXRLabelData(xRTable.Rows[2].Cells[3], a_datas[0].Rows[0][2].ToString());
-            setXRLabelData(xRTable.Rows[2].Cells[4], a_datas[0].Rows[0][3].ToString());
-            setXRLabelData(xRTable.Rows[2].Cells[5], a_datas[0].Rows[0][4].ToString());
-            setXRLabelData(xRTable.Rows[2].Cells[6], a_datas[0].Rows[0][5].ToString());
-            setXRLabelData(xRTable.Rows[2].Cells[7], a_datas[0].Rows[0][6].ToString());
-            setXRLabelData(xRTable.Rows[2].Cells[8], a_datas[0].Rows[0][7].ToString());
-            setXRLabelData(xRTable.Rows[2].Cells[9], a_datas[0].Rows[0][8].ToString());
-            setXRLabelData(xRTable.Rows[2].Cells[10], a_datas[0].Rows[0][9].ToString());
-            setXRLabelData(xRTable.Rows[2].Cells[11], a_datas[0].Rows[0][10].ToString());
-            setXRLabelData(xRTable.Rows[2].Cells[12], a_datas[0].Rows[0][11].ToString());
+            setXRLabelData(xRTable.Rows[2].Cells[3], a_datas[0].Rows[0][4].ToString());
+            setXRLabelData(xRTable.Rows[2].Cells[4], a_datas[0].Rows[0][5].ToString());
+            setXRLabelData(xRTable.Rows[2].Cells[5], a_datas[0].Rows[0][6].ToString());
+            setXRLabelData(xRTable.Rows[2].Cells[6], a_datas[0].Rows[0][7].ToString());
+            setXRLabelData(xRTable.Rows[2].Cells[7], a_datas[0].Rows[0][8].ToString());
+            setXRLabelData(xRTable.Rows[2].Cells[8], a_datas[0].Rows[0][9].ToString());
+            setXRLabelData(xRTable.Rows[2].Cells[9], a_datas[0].Rows[0][10].ToString());
+            setXRLabelData(xRTable.Rows[2].Cells[10], a_datas[0].Rows[0][11].ToString());
+            setXRLabelData(xRTable.Rows[2].Cells[11], a_datas[0].Rows[0][12].ToString());
+            setXRLabelData(xRTable.Rows[2].Cells[12], a_datas[0].Rows[0][13].ToString());
             List<List<ElementalAnalysisDEVData>> list_ElementalAnalysisData = new List<List<ElementalAnalysisDEVData>>();
             for (int i = 0; i < a_datas[1].Rows.Count; i++)
             {
                 double quantity = 0;
-                for (int a = 2; a < 12; a++)
+                for (int a = 4; a < 12; a++)
                 {
                     if (a_datas[1].Rows[i][a].ToString() != "")
                     {
@@ -1941,8 +1941,8 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
                     }
                 }
                 list_ElementalAnalysisData.Add(set_ElementalAnalysis(subscript.Getsubscriptstring(a_datas[1].Rows[i]["Class"].ToString()), subscript.Getsubscriptstring(a_datas[1].Rows[i]["Name"].ToString()), a_datas[1].Rows[i]["Area"].ToString(),
-                   a_datas[1].Rows[i][2].ToString(), a_datas[1].Rows[i][3].ToString(), a_datas[1].Rows[i][4].ToString(), a_datas[1].Rows[i][5].ToString(), a_datas[1].Rows[i][6].ToString(),
-                   a_datas[1].Rows[i][7].ToString(), a_datas[1].Rows[i][8].ToString(), a_datas[1].Rows[i][9].ToString(), a_datas[1].Rows[i][10].ToString(), a_datas[1].Rows[i][11].ToString()));
+                   a_datas[1].Rows[i][4].ToString(), a_datas[1].Rows[i][5].ToString(), a_datas[1].Rows[i][6].ToString(), a_datas[1].Rows[i][7].ToString(), a_datas[1].Rows[i][8].ToString(),
+                   a_datas[1].Rows[i][9].ToString(), a_datas[1].Rows[i][10].ToString(), a_datas[1].Rows[i][11].ToString(), a_datas[1].Rows[i][12].ToString(), a_datas[1].Rows[i][13].ToString()));
             }
             for (int i = 0; i < a_datas[1].Rows.Count; i++)
             {
@@ -2009,39 +2009,39 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
 
 
             int ls = 0;
-            DataTable REORDER_data = REORDER(a_datas[1], "TypeId");
-            if (REORDER_data.Rows.Count == 0)
-                return;
+            //DataTable REORDER_data = REORDER(a_datas[1], "TypeId");
+            //if (REORDER_data.Rows.Count == 0)
+            //    return;
 
-            for (int i = 0; i < REORDER_data.Rows.Count; i++)
-            {
-                if (REORDER_data.Rows[i]["Name"].ToString() == "" || REORDER_data.Rows[i]["Name"].ToString() == null)
-                {
-                    ls = i;
-                    continue;
-                }
-            }
+            //for (int i = 0; i < REORDER_data.Rows.Count; i++)
+            //{
+            //    if (REORDER_data.Rows[i]["Name"].ToString() == "" || REORDER_data.Rows[i]["Name"].ToString() == null)
+            //    {
+            //        ls = i;
+            //        continue;
+            //    }
+            //}
 
           
             List<List<ElementalAnalysisDEVData>> list_ElementalAnalysisData = new List<List<ElementalAnalysisDEVData>>();
-            for (int i = 0; i < REORDER_data.Rows.Count; i++)
+            for (int i = 0; i < a_datas[1].Rows.Count; i++)
             {
                 double quantity = 0;
-                for (int a = 2; a < 12; a++)
+                for (int a = 4; a < 12; a++)
                 {
-                    if (REORDER_data.Rows[i][a].ToString() != "")
+                    if (a_datas[1].Rows[i][a].ToString() != "")
                     {
-                        if (double.TryParse(REORDER_data.Rows[i][a].ToString(), out double number))
+                        if (double.TryParse(a_datas[1].Rows[i][a].ToString(), out double number))
                         {
                             quantity = quantity + number;
                         }
                     }
                 }
-                list_ElementalAnalysisData.Add(set_ElementalAnalysisS(subscript.Getsubscriptstring(REORDER_data.Rows[i]["Name"].ToString()), REORDER_data.Rows[i]["Area"].ToString(),
-                   REORDER_data.Rows[i][2].ToString(), REORDER_data.Rows[i][3].ToString(), REORDER_data.Rows[i][4].ToString(), REORDER_data.Rows[i][5].ToString(), REORDER_data.Rows[i][6].ToString(),
-                   REORDER_data.Rows[i][7].ToString(), REORDER_data.Rows[i][8].ToString(), REORDER_data.Rows[i][9].ToString(), REORDER_data.Rows[i][10].ToString(), REORDER_data.Rows[i][11].ToString()));
+                list_ElementalAnalysisData.Add(set_ElementalAnalysisS(subscript.Getsubscriptstring(a_datas[1].Rows[i]["Name"].ToString()), a_datas[1].Rows[i]["Area"].ToString(),
+				   a_datas[1].Rows[i][2].ToString(), a_datas[1].Rows[i][3].ToString(), a_datas[1].Rows[i][4].ToString(), a_datas[1].Rows[i][5].ToString(), a_datas[1].Rows[i][6].ToString(),
+				   a_datas[1].Rows[i][7].ToString(), a_datas[1].Rows[i][8].ToString(), a_datas[1].Rows[i][9].ToString(), a_datas[1].Rows[i][10].ToString(), a_datas[1].Rows[i][11].ToString()));
             }
-            for (int i = 0; i < REORDER_data.Rows.Count; i++)
+            for (int i = 0; i < a_datas[1].Rows.Count; i++)
             {
                 XRTableRow row = new XRTableRow();
                 XRTableCell tCell_subdivision = new XRTableCell();
@@ -2093,9 +2093,18 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
         public void setElementAvgGrid()
         {
             ElementalAnalysis elementalAnalysis = new ElementalAnalysis();
-           
+
+            if (basicData.GetIsThereAMajorClassification())
+            {
                 List<DataTable> datas = elementalAnalysis.GetElementData(basicData, m_otsreport_export);
-                add_SetElementAvgGrid(datas);
+                add_SetElementAvgGridS(datas);
+            }
+            else
+            {
+				List<DataTable> datas = elementalAnalysis.GetElementData(basicData, m_otsreport_export);
+				add_SetElementAvgGrid(datas);
+			}
+                
            
                
         }