zhangjiaxin 1 год назад
Родитель
Сommit
d31ae6ea21

+ 32 - 8
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/ElementalAnalysis.cs

@@ -63,10 +63,10 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                     }
                     else
                     {
-                        if (getClass_dt.Rows[i]["GroupName"].ToString() != "Default")
-                        {
+                        //if (getClass_dt.Rows[i]["GroupName"].ToString() != "Default")
+                        //{
                             ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
-                        }
+                        //}
                     }
             }
 
@@ -178,18 +178,42 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                 return m_bt_DBData;
             }
             DataTable datass = m_bt_DBData.Clone();
-            for (int i = 0; i < m_bt_DBData.Rows.Count; i++)
+
+            for (int i = 0; i < m_mbszclass.list_str_MainPriority.Count; i++)
             {
-                for (int a = 0; a < m_mbszclass.list_str_MainPriority.Count; a++)
+                bool bl = false;
+                for (int a = 0; a < m_bt_DBData.Rows.Count; a++)
                 {
-                    if (m_bt_DBData.Rows[i]["TypeName"].ToString() == m_mbszclass.list_str_MainPriority[a])
+                    if (m_bt_DBData.Rows[a]["TypeName"].ToString() == m_mbszclass.list_str_MainPriority[i])
                     {
-                        datass.Rows.Add(m_bt_DBData.Rows[i].ItemArray);
+                        datass.Rows.Add(m_bt_DBData.Rows[a].ItemArray);
+                        bl = true;
                         continue;
                     }
                 }
-            }
+                if (!bl)
+                {
+                    DataTable dta = m_bt_DBData.Clone();
+                    dta.Rows.Add(m_bt_DBData.Rows[0].ItemArray);
+                    for (int b = 0; b < dta.Columns.Count; b++)
+                    {
+                        if (dta.Columns[b].ColumnName == "TypeName")
+                        {
+                            dta.Rows[0][b] = m_mbszclass.list_str_MainPriority[i];
+                        }
+                        else if (dta.Columns[b].ColumnName == "Class")
+                        {
+                            dta.Rows[0][b] = "Default";
+                        }
+                        else
+                        {
+                            dta.Rows[0][b] = 0;
+                        }
+                    }
 
+                    datass.Rows.Add(dta.Rows[0].ItemArray);
+                }
+            }
             return datass;
         }
         private DataTable GetParticleListForParticlSize(DataTable data, DataTable table)

+ 41 - 4
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/ParticleAnalysis.cs

@@ -1108,18 +1108,55 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
             }
 
             DataTable datass = m_bt_DBData.Clone();
-            for (int i = 0; i < m_bt_DBData.Rows.Count; i++)
+
+            for (int i=0;i< m_mbszclass.list_str_MainPriority.Count;i++)
             {
-                for (int a = 0; a < m_mbszclass.list_str_MainPriority.Count; a++)
+                bool bl = false;
+                for (int a = 0; a < m_bt_DBData.Rows.Count; a++)
                 {
-                    if (m_bt_DBData.Rows[i]["TypeName"].ToString() == m_mbszclass.list_str_MainPriority[a])
+                    if (m_bt_DBData.Rows[a]["TypeName"].ToString() == m_mbszclass.list_str_MainPriority[i])
                     {
-                        datass.Rows.Add(m_bt_DBData.Rows[i].ItemArray);
+                        datass.Rows.Add(m_bt_DBData.Rows[a].ItemArray);
+                        bl = true;
                         continue;
                     }
                 }
+                if(!bl)
+                {
+                    DataTable dta= m_bt_DBData.Clone();
+                    dta.Rows.Add(m_bt_DBData.Rows[0].ItemArray);
+                    for (int b=0;b< dta.Columns.Count;b++)
+                    {
+                        if(dta.Columns[b].ColumnName== "TypeName")
+                        {
+                            dta.Rows[0][b]= m_mbszclass.list_str_MainPriority[i];
+                        }
+                        else if (dta.Columns[b].ColumnName == "Class")
+                        {
+                            dta.Rows[0][b] = "Default";
+                        }
+                        else
+                        {
+                            dta.Rows[0][b] = 0;
+                        }
+                    }
+
+                    datass.Rows.Add(dta.Rows[0].ItemArray);
+                }
             }
 
+            //for (int i = 0; i < m_bt_DBData.Rows.Count; i++)
+            //{
+            //    for (int a = 0; a < m_mbszclass.list_str_MainPriority.Count; a++)
+            //    {
+            //        if (m_bt_DBData.Rows[i]["TypeName"].ToString() == m_mbszclass.list_str_MainPriority[a])
+            //        {
+            //            datass.Rows.Add(m_bt_DBData.Rows[i].ItemArray);
+            //            continue;
+            //        }
+            //    }
+            //}
+
             return datass;
         }
 

+ 21 - 4
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/ParticleList.cs

@@ -440,14 +440,31 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                 dr["Hardness_detailed"] = dt_stl.Rows[i]["Hardness"].ToString();
                 if (System.Text.RegularExpressions.Regex.Replace(dt_stl.Rows[i]["Hardness"].ToString(), @"[^\d.\d]", "").ToString() != "")
                 {
-                    if (System.Text.RegularExpressions.Regex.Replace(dt_stl.Rows[i]["Hardness"].ToString(), @"[^\d.\d]", "") == "o. Def.")
+                    try
                     {
-                        dr["Hardness"] = 0;
+                        if (System.Text.RegularExpressions.Regex.Replace(dt_stl.Rows[i]["Hardness"].ToString(), @"[^\d.\d]", "") == "o. Def.")
+                        {
+                            dr["Hardness"] = 0;
+                        }
+                        else
+                        {
+                            dr["Hardness"] = Convert.ToDouble(System.Text.RegularExpressions.Regex.Replace(dt_stl.Rows[i]["Hardness"].ToString(), @"[^\d.\d]", ""));
+                        }
                     }
-                    else
+                    catch
                     {
-                        dr["Hardness"] = Convert.ToDouble(System.Text.RegularExpressions.Regex.Replace(dt_stl.Rows[i]["Hardness"].ToString(), @"[^\d.\d]", ""));
+                        dr["Hardness"] = 0;
                     }
+
+                    //if (System.Text.RegularExpressions.Regex.Replace(dt_stl.Rows[i]["Hardness"].ToString(), @"[^\d.\d]", "") == "o. Def."||
+                    //    System.Text.RegularExpressions.Regex.Replace(dt_stl.Rows[i]["Hardness"].ToString(), @"[^\d.\d]", "") == "o.Def.")
+                    //{
+                    //    dr["Hardness"] = 0;
+                    //}
+                    //else
+                    //{
+                    //    dr["Hardness"] = Convert.ToDouble(System.Text.RegularExpressions.Regex.Replace(dt_stl.Rows[i]["Hardness"].ToString(), @"[^\d.\d]", ""));
+                    //}
                 }
                 else
                 {

+ 47 - 30
OTSIncAReportApp/1-UI/OTSReportExport/Template/DataTemplate.Designer.cs

@@ -38,6 +38,10 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             this.xrLine2 = new DevExpress.XtraReports.UI.XRLine();
             this.dev_yj = new DevExpress.XtraReports.UI.XRLabel();
             this.Detail = new DevExpress.XtraReports.UI.DetailBand();
+            this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel();
+            this.xrTable3 = new DevExpress.XtraReports.UI.XRTable();
+            this.xrTableRow9 = new DevExpress.XtraReports.UI.XRTableRow();
+            this.xrTableCell3 = new DevExpress.XtraReports.UI.XRTableCell();
             this.xrTable2 = new DevExpress.XtraReports.UI.XRTable();
             this.xrTableRow8 = new DevExpress.XtraReports.UI.XRTableRow();
             this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell();
@@ -95,9 +99,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             this.dev_ypbh_up = new DevExpress.XtraReports.UI.XRLabel();
             this.dev_fbt = new DevExpress.XtraReports.UI.XRLabel();
             this.dev_zbt = new DevExpress.XtraReports.UI.XRLabel();
-            this.xrTable3 = new DevExpress.XtraReports.UI.XRTable();
-            this.xrTableRow9 = new DevExpress.XtraReports.UI.XRTableRow();
-            this.xrTableCell3 = new DevExpress.XtraReports.UI.XRTableCell();
+            ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.xrChart1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.xrChart_ParticelSizeSubdivision)).BeginInit();
@@ -107,7 +109,6 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             ((System.ComponentModel.ISupportInitialize)(this.xrChart_incaClass)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.xrChart_ParticelSizeCalss)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
             // 
             // TopMargin
@@ -139,7 +140,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             this.xrLabel_pageinfo,
             this.xrLine2,
             this.dev_yj});
-            this.BottomMargin.HeightF = 67.08368F;
+            this.BottomMargin.HeightF = 67F;
             this.BottomMargin.Name = "BottomMargin";
             // 
             // xrLabel_pageinfo
@@ -173,6 +174,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             // Detail
             // 
             this.Detail.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
+            this.xrLabel1,
             this.xrTable3,
             this.xrTable2,
             this.xrChart1,
@@ -197,6 +199,43 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             this.Detail.HeightF = 5064.223F;
             this.Detail.Name = "Detail";
             // 
+            // xrLabel1
+            // 
+            this.xrLabel1.BackColor = System.Drawing.Color.DarkGray;
+            this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 1054F);
+            this.xrLabel1.Multiline = true;
+            this.xrLabel1.Name = "xrLabel1";
+            this.xrLabel1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
+            this.xrLabel1.SizeF = new System.Drawing.SizeF(688F, 23F);
+            this.xrLabel1.StylePriority.UseBackColor = false;
+            this.xrLabel1.StylePriority.UseTextAlignment = false;
+            this.xrLabel1.Text = "颗粒堆叠图";
+            this.xrLabel1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
+            this.xrLabel1.Visible = false;
+            // 
+            // xrTable3
+            // 
+            this.xrTable3.LocationFloat = new DevExpress.Utils.PointFloat(30.41687F, 828.5415F);
+            this.xrTable3.Name = "xrTable3";
+            this.xrTable3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 96F);
+            this.xrTable3.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
+            this.xrTableRow9});
+            this.xrTable3.SizeF = new System.Drawing.SizeF(630.0001F, 90.625F);
+            // 
+            // xrTableRow9
+            // 
+            this.xrTableRow9.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
+            this.xrTableCell3});
+            this.xrTableRow9.Name = "xrTableRow9";
+            this.xrTableRow9.Weight = 1D;
+            // 
+            // xrTableCell3
+            // 
+            this.xrTableCell3.Multiline = true;
+            this.xrTableCell3.Name = "xrTableCell3";
+            this.xrTableCell3.Text = "xrTableCell3";
+            this.xrTableCell3.Weight = 1D;
+            // 
             // xrTable2
             // 
             this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(30.41687F, 803.5415F);
@@ -812,29 +851,6 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             this.dev_zbt.Text = "dev_zbt";
             this.dev_zbt.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
             // 
-            // xrTable3
-            // 
-            this.xrTable3.LocationFloat = new DevExpress.Utils.PointFloat(30.41687F, 828.5415F);
-            this.xrTable3.Name = "xrTable3";
-            this.xrTable3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 96F);
-            this.xrTable3.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
-            this.xrTableRow9});
-            this.xrTable3.SizeF = new System.Drawing.SizeF(630.0001F, 90.625F);
-            // 
-            // xrTableRow9
-            // 
-            this.xrTableRow9.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
-            this.xrTableCell3});
-            this.xrTableRow9.Name = "xrTableRow9";
-            this.xrTableRow9.Weight = 1D;
-            // 
-            // xrTableCell3
-            // 
-            this.xrTableCell3.Multiline = true;
-            this.xrTableCell3.Name = "xrTableCell3";
-            this.xrTableCell3.Text = "xrTableCell3";
-            this.xrTableCell3.Weight = 1D;
-            // 
             // OTS_DEVReport
             // 
             this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
@@ -842,8 +858,9 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             this.BottomMargin,
             this.Detail});
             this.Font = new System.Drawing.Font("Arial", 9.75F);
-            this.Margins = new System.Drawing.Printing.Margins(77, 85, 73, 67);
+            this.Margins = new System.Drawing.Printing.Margins(77, 84, 73, 67);
             this.Version = "21.2";
+            ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.xrChart1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.xrChart_ParticelSizeSubdivision)).EndInit();
@@ -853,7 +870,6 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             ((System.ComponentModel.ISupportInitialize)(this.xrChart_incaClass)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.xrChart_ParticelSizeCalss)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this)).EndInit();
 
         }
@@ -928,5 +944,6 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
         private DevExpress.XtraReports.UI.XRTable xrTable3;
         private DevExpress.XtraReports.UI.XRTableRow xrTableRow9;
         private DevExpress.XtraReports.UI.XRTableCell xrTableCell3;
+        private DevExpress.XtraReports.UI.XRLabel xrLabel1;
     }
 }

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

@@ -371,8 +371,12 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
                 list_ParticelSizeData.Add(switch_ParticleSize(subscript.Getsubscriptstring(REORDER_data.Rows[i]["Class"].ToString()), subscript.Getsubscriptstring(REORDER_data.Rows[i]["Name"].ToString()), REORDER_data.Rows[i]["total"].ToString(), REORDER_data.Rows[i]["c1"].ToString(), REORDER_data.Rows[i]["c2"].ToString(), REORDER_data.Rows[i]["c3"].ToString(),
                    REORDER_data.Rows[i]["c4"].ToString(), REORDER_data.Rows[i]["c5"].ToString(), REORDER_data.Rows[i]["c6"].ToString(), REORDER_data.Rows[i]["c7"].ToString()));
             }
-            REORDER_data.Rows[ls].Delete();
-            REORDER_data.AcceptChanges();
+            //if (REORDER_data.Rows.Count!=1)
+            //{
+            //    REORDER_data.Rows[ls].Delete();
+            //    REORDER_data.AcceptChanges();
+            //}
+            
             
             setXRLabelData(xrTa_ParticleSizeTable.Rows[2].Cells[0], GetlanguageData("dev_classify", languageData));//二级分类(子分类)
             setXRLabelData(xrTa_ParticleSizeTable.Rows[2].Cells[1], GetlanguageData("dev_quantity", languageData));//数量
@@ -497,6 +501,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
         private DataTable REORDER(DataTable data,string field)
         {
             DataTable dataTable = data.Clone();
+            List<int> vs = new List<int>();
            
             for (int i=0;i< data.Rows.Count;i++)
             {
@@ -517,7 +522,26 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
                     dataTable.Rows.Add(data.Rows[i].ItemArray);
                 }
             }
-           
+            
+            for (int i=0;i< dataTable.Rows.Count;i++)
+            {
+                if (!string.IsNullOrWhiteSpace(dataTable.Rows[i]["Class"].ToString()))
+                {
+                    //vs.Add(i);
+                    dataTable.Rows[i].Delete();
+                }
+
+                //dataTable.Rows[i].Delete();
+            }
+
+            //for (int i=0;i<vs.Count;i++)
+            //{
+            //    dataTable.Rows[i].Delete();
+            //}
+            dataTable.AcceptChanges();
+            //    dataTable.Rows[ls].Delete();
+            //    dataTable.AcceptChanges();
+
             return dataTable.Copy();
        
         }
@@ -682,6 +706,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
 
         private void HistogramChart(ParticleAnalysis particleList)
         {
+            XRPageBreak();
             List<Series> seriesList = new List<Series>();
             DataTable dataTable = particleList.ParticleResults(TemplateClass, m_otsreport_export, ComputeMode);
             DataTable TypeRange = particleList.TypeRange(TemplateClass, m_otsreport_export);
@@ -689,6 +714,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             {
                 return;
             }
+            xrLabel1.Visible = true;
             xrChart1.Visible = true;
             DataTable dt = new DataTable();
             dt.Columns.Add("name");
@@ -736,6 +762,9 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             ((XYDiagram)xrChart1.Diagram).AxisX.Title.Font = new Font("Tahoma", 9);
             ((XYDiagram)xrChart1.Diagram).AxisY.Title.Alignment = StringAlignment.Far;
             ((XYDiagram)xrChart1.Diagram).AxisX.Title.Alignment = StringAlignment.Far;
+
+            xrLabel1.LocationF = new PointF(xrLabel1.LocationF.X, NeueStartposition);
+            NeueStartposition = xrLabel1.LocationF.Y + xrLabel1.SizeF.Height ;
             xrChart1.LocationF = new PointF(xrChart1.LocationF.X, NeueStartposition);
             NeueStartposition = xrChart1.LocationF.Y + xrChart1.SizeF.Height + 20;
         }
@@ -851,8 +880,8 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
                     continue;
                 }
             }
-            REORDER_data.Rows[ls].Delete();
-            REORDER_data.AcceptChanges();
+            //REORDER_data.Rows[ls].Delete();
+            //REORDER_data.AcceptChanges();