Browse Source

修改BUG报告程序颗粒尺寸图显示不对的问题——张佳鑫

gaoshipeng 2 năm trước cách đây
mục cha
commit
30a8b61629

+ 25 - 1
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -1414,7 +1414,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
         }
 
-        public void ParticleSizeTable(c_TemplateClass m_mbszclass, out DataTable surface_dt, out DataTable partsize_dt, out DataTable class_dt, out DataTable subdivide_dt)
+        public void ParticleSizeTable(c_TemplateClass m_mbszclass, out DataTable surface_dt, out DataTable partsize_dt, out DataTable class_dt, out DataTable subdivide_dt, out DataTable colid_data)
         {
             //全部大类
             DataTable dt_addCalss = new DataTable();
@@ -1529,6 +1529,30 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
             }
 
+            //颗粒尺寸数据(例 1.5有多少,2.0有多少)
+            colid_data = new DataTable();
+            colid_data.Columns.Add("name");
+            colid_data.Columns.Add("quantity",typeof(double));
+            for (int i=0;i< ls_Particel_dt.Columns.Count;i++)
+            {
+                
+                if (ls_Particel_dt.Columns[i].ColumnName=="c"+(i+1).ToString())
+                {
+                    if (i< colid.Count)
+                    {
+                        DataRow dr1 = colid_data.NewRow();
+                        dr1["name"] = colid[i].ToString();
+                        int quantity = 0;
+                        for (int a = 0; a < ls_Particel_dt.Rows.Count; a++)
+                        {
+                            quantity = quantity + Convert.ToInt32(ls_Particel_dt.Rows[a][i].ToString());
+                        }
+                        dr1["quantity"] = quantity.ToString();
+                        colid_data.Rows.Add(dr1);
+                    }
+                }
+            }
+
             //获取大分类信息
             DataTable dt = InvalidRemoval(QuantityOfIntegratedSubstances(ls_Particel_dt, ClassName), "Class");
             dt_addCalss = dt.Copy();

+ 1 - 1
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_Export.cs

@@ -1533,7 +1533,7 @@ namespace OTSIncAReportApp
                     {
 
                         if (m_mbszclass.M_KLFXJG.b_ck_klcc_xsmk)
-                            DEVReport.setParticleSizeTable(true,true);
+                            DEVReport.setParticleSizeTable(true,false);
                         lock (m_thread_flag)
                             m_thread_flag = strNill;
                     }

+ 6 - 6
OTSIncAReportApp/ReportTemplate/OTS_DEVReport.cs

@@ -164,7 +164,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
         {
             //ElementSubscript subscript = new ElementSubscript();
             //    Export_ReportTemplate export_ReportTemplate = new Export_ReportTemplate(m_otsreport_export);
-            export_ReportTemplate.ParticleSizeTable(TemplateClass, out DataTable surface_dt, out DataTable ls_partsize_dt, out DataTable class_dt, out DataTable subdivde_dt);
+            export_ReportTemplate.ParticleSizeTable(TemplateClass, out DataTable surface_dt, out DataTable ls_partsize_dt, out DataTable class_dt, out DataTable subdivde_dt,out DataTable colid_data);
 
             for (int i=0;i< class_dt.Rows.Count;i++)
             {
@@ -254,19 +254,19 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
                 DataTable dt_class_dt = dv.ToTable();
 
                 // 实例化饼图对象
-                Series pieSeriesClass = new Series("颗粒尺寸分类", ViewType.Pie);
+                Series pieSeriesClass = new Series("尺寸分类", ViewType.Pie);
                 pieSeriesClass.ArgumentScaleType = ScaleType.Qualitative;
                 // 项目名称
-                pieSeriesClass.ArgumentDataMember = "Class";
+                pieSeriesClass.ArgumentDataMember = "name";
                 pieSeriesClass.ValueScaleType = ScaleType.Numerical;
                 //取值字段
-                pieSeriesClass.ValueDataMembers.AddRange(new string[] { "total" });
+                pieSeriesClass.ValueDataMembers.AddRange(new string[] { "quantity" });
                 (pieSeriesClass.Label as PieSeriesLabel).Position = PieSeriesLabelPosition.Inside;
                 //显示百分比
                 pieSeriesClass.PointOptions.PointView = PointView.ArgumentAndValues;
                 pieSeriesClass.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
                 //设置数据源
-                pieSeriesClass.DataSource = dt_class_dt;
+                pieSeriesClass.DataSource = colid_data;
                 pieSeriesClass.LabelsVisibility = DevExpress.Utils.DefaultBoolean.False;
                 // 饼图空间添加 新建的饼图对象
                 xrChart_ParticelSizeCalss.Series.Add(pieSeriesClass);
@@ -288,7 +288,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
                     xrChart_ParticelSizeSubdivision.LocationF = xrChart_ParticelSizeCalss.LocationF;
                 }
 
-                xrLabel_size_IconQuestion_Subdivision.Visible = true;
+                xrLabel_size_IconQuestion_Subdivision.Visible = false;
                 DataView dv2 = subdivde_dt.DefaultView;
                 dv2.Sort = "total DESC";
                 DataTable dt_subdivde_dt = dv2.ToTable();