Pārlūkot izejas kodu

修改报告导出bug颗粒列表统计的数量不对

zhangjiaxin 1 gadu atpakaļ
vecāks
revīzija
e3c8a3b364

+ 41 - 3
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/InclusionProportion.cs

@@ -244,10 +244,48 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
             
 
             DataTable m_bt_DBData = fielddata.GetAreaByAllIncA("");//获取所有分类面积和数量信息
-           
+
+
+
+            //按照list列表进行物质类排序,物质类中的元素分类按照面积的大小进行排序
+            List<string> ClassName = new List<string>();
+            DataTable getClass_dt = fielddata.GetAllClass();
+            bool bl = false;
+            for (int i = 0; i < getClass_dt.Rows.Count; i++)
+            {
+                if (getClass_dt.Rows[i]["GroupName"].ToString() != "NOT_INCLUTION" && getClass_dt.Rows[i]["GroupName"].ToString() != "Invalid"
+                && getClass_dt.Rows[i]["GroupName"].ToString() != "Not Identified")
+                    if (getClass_dt.Rows[i]["GroupName"].ToString() == "")
+                    {
+                        if (!bl)
+                        {
+                            ClassName.Add("Default");
+                            bl = true;
+                        }
+                    }
+                    else
+                    {
+                        if (getClass_dt.Rows[i]["GroupName"].ToString() != "Default")
+                        {
+                            ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
+                        }
+                    }
+            }
+            DataTable dataTable = m_bt_DBData.Clone();
+            for (int i=0;i< m_bt_DBData.Rows.Count;i++)
+            {
+                for (int a=0;a< ClassName.Count;a++)
+                {
+                    if (m_bt_DBData.Rows[i]["GroupName"].ToString()== ClassName[a].ToString())
+                    {
+                        dataTable.Rows.Add(m_bt_DBData.Rows[i].ItemArray);
+                    }
+                }
+            }
+
             if (m_mbszclass.list_str_MainPriority.Count==0)
             {
-                return ConSolidateInvalid(m_bt_DBData);
+                return ConSolidateInvalid(dataTable);
             }
             DataTable data = m_bt_DBData.Clone();
             for (int i = 0; i < m_bt_DBData.Rows.Count; i++)
@@ -262,7 +300,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                 }
             }
 
-            return ConSolidateInvalid(data);
+            return ConSolidateInvalid(dataTable);
         }
 
         /// <summary>

+ 21 - 8
OTSIncAReportApp/1-UI/OTSReportExport/Template/DataTemplate.cs

@@ -208,7 +208,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             xrTa_ParticleSizeTable.Rows[1].Cells[0].TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
             xrTa_ParticleSizeTable.Rows[1].Cells[0].Text = xrTa_ParticleSizeTable.Rows[1].Cells[0].Text + ComputeModeName + "(μm)";
             xrTa_ParticleSizeTable.Rows[1].Cells[0].Font = new Font(Schriftart_chinese, xrTa_ParticleSizeTable.Rows[1].Cells[0].Font.Size);
-
+            int total = 0;
             for (int i = 0; i < CompositeData[1].Rows.Count; i++)
             {
                 XRTableRow row = new XRTableRow();
@@ -245,6 +245,11 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
                 XRTableCellData(row, tCell_size_7, Schriftart_english, DevExpress.XtraPrinting.TextAlignment.MiddleCenter, "Text", list_ParticelSizeData[i], "size_7");
                 xrTa_ParticleSizeTable.Rows.Add(row);
 
+                if (CompositeData[1].Rows[i]["Name"].ToString()!="")
+                {
+                    total += Convert.ToInt32(CompositeData[1].Rows[i]["total"]);
+                }
+
             }
             this.Detail.Controls.Add(xrTa_ParticleSizeTable);
             xrTa_ParticleSizeTable.LocationF = new PointF(10f, 940f);
@@ -263,10 +268,10 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             vs.Add(0);
             vs.Add(0);
             vs.Add(0);
-            int total = 0;
+            
             for (int i = 0; i < surface_dt2.Rows.Count; i++)
             {
-                for (int a = 1; a < 11; a++)
+                for (int a = 1; a < 10; a++)
                 {
                     if (surface_dt2.Rows[i]["c" + a.ToString()] != " " && surface_dt2.Rows[i]["c" + a.ToString()] != "" && surface_dt2.Rows[i]["c" + a.ToString()] != null)
                     {
@@ -275,7 +280,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
                             vs[a - 1] += Convert.ToInt32(result);
                     }
                 }
-                total += Convert.ToInt32(surface_dt2.Rows[i]["total"]);
+                //total += Convert.ToInt32(surface_dt2.Rows[i]["total"]);
             }
             setXRLabelData(xrTable3.Rows[0].Cells[0], GetlanguageData("dev_total", languageData));
             //xrTable3.Rows[0].Cells[0].Text = "总数量";
@@ -402,7 +407,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             int total = 0;
             for (int i = 0; i < surface_dt2.Rows.Count; i++)
             {
-                for (int a = 1; a < 11; a++)
+                for (int a = 1; a < 10; a++)
                 {
                     if (surface_dt2.Rows[i]["c" + a.ToString()] != " " && surface_dt2.Rows[i]["c" + a.ToString()] != "" && surface_dt2.Rows[i]["c" + a.ToString()] != null)
                     {
@@ -484,7 +489,15 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             DataTable classData= particleList.GetLargeClassification(TemplateClass, m_otsreport_export, ComputeMode);
             DataTable subdivdeData = particleList.GetSubClassification(TemplateClass, m_otsreport_export, ComputeMode);
             DataTable chartmax= particleList.GetChartDataCalss(TemplateClass, m_otsreport_export, ComputeMode);
-            DataTable surface_dt2 = particleList.ParticleResults(TemplateClass, m_otsreport_export, ComputeMode);
+            //DataTable surface_dt2 = particleList.ParticleResults(TemplateClass, m_otsreport_export, ComputeMode);
+            DataTable surface_dt2 = CompositeData[1].Clone();
+            for (int i=0;i< CompositeData[1].Rows.Count;i++)
+            {
+                if (CompositeData[1].Rows[i]["Name"].ToString()!="")
+                {
+                    surface_dt2.Rows.Add(CompositeData[1].Rows[i].ItemArray);
+                }
+            }
 
             for (int i = 0; i < classData.Rows.Count; i++)
             {
@@ -562,10 +575,10 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
 
 
             xrChart_ParticelSizeSubdivision.Visible = false;
-            if (a_pieSeries && subdivdeData.Rows.Count>0)
+            if (a_pieSeries && surface_dt2.Rows.Count>0)
             {
 
-                DataView dv2 = subdivdeData.DefaultView;
+                DataView dv2 = surface_dt2.DefaultView;
                 dv2.Sort = "total DESC";
                 DataTable dt_subdivde_dt = dv2.ToTable();