فهرست منبع

报表增加页码显示,修复增加分类图形选择(代码里操控)

zhangjiaxin 2 سال پیش
والد
کامیت
b14431350b

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

@@ -1533,7 +1533,7 @@ namespace OTSIncAReportApp
                     {
 
                         if (m_mbszclass.M_KLFXJG.b_ck_klcc_xsmk)
-                            DEVReport.setParticleSizeTable();
+                            DEVReport.setParticleSizeTable(true,true);
                         lock (m_thread_flag)
                             m_thread_flag = strNill;
                     }
@@ -1796,7 +1796,7 @@ namespace OTSIncAReportApp
             //DEVReport = new OTS_DEVReport(this);
 
             DEVReport.setResultGrid();
-            DEVReport.setParticleSizeTable();
+            DEVReport.setParticleSizeTable(true,true);
             DEVReport.setElementAvgGrid();
             DEVReport.setINCAtable();
             DEVReport.set_incaPIC_classify();

+ 21 - 8
OTSIncAReportApp/ReportTemplate/OTS_DEVReport.Designer.cs

@@ -35,6 +35,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             this.dev_ym = new DevExpress.XtraReports.UI.XRLabel();
             this.xrPictureBox1 = new DevExpress.XtraReports.UI.XRPictureBox();
             this.BottomMargin = new DevExpress.XtraReports.UI.BottomMarginBand();
+            this.xrLabel_pageinfo = new DevExpress.XtraReports.UI.XRLabel();
             this.xrLine2 = new DevExpress.XtraReports.UI.XRLine();
             this.dev_yj = new DevExpress.XtraReports.UI.XRLabel();
             this.Detail = new DevExpress.XtraReports.UI.DetailBand();
@@ -230,25 +231,36 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             // BottomMargin
             // 
             this.BottomMargin.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
+            this.xrLabel_pageinfo,
             this.xrLine2,
             this.dev_yj});
-            this.BottomMargin.HeightF = 67F;
+            this.BottomMargin.HeightF = 54.87563F;
             this.BottomMargin.Name = "BottomMargin";
             // 
+            // xrLabel_pageinfo
+            // 
+            this.xrLabel_pageinfo.LocationFloat = new DevExpress.Utils.PointFloat(560.0004F, 23.00002F);
+            this.xrLabel_pageinfo.Multiline = true;
+            this.xrLabel_pageinfo.Name = "xrLabel_pageinfo";
+            this.xrLabel_pageinfo.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
+            this.xrLabel_pageinfo.SizeF = new System.Drawing.SizeF(117.9998F, 23F);
+            this.xrLabel_pageinfo.Text = "xrLabel_pageinfo";
+            this.xrLabel_pageinfo.PrintOnPage += new DevExpress.XtraReports.UI.PrintOnPageEventHandler(this.xrLabel_pageinfo_PrintOnPage);
+            // 
             // xrLine2
             // 
             this.xrLine2.LineWidth = 2F;
-            this.xrLine2.LocationFloat = new DevExpress.Utils.PointFloat(10.0001F, 9.999847F);
+            this.xrLine2.LocationFloat = new DevExpress.Utils.PointFloat(10.0001F, 0F);
             this.xrLine2.Name = "xrLine2";
             this.xrLine2.SizeF = new System.Drawing.SizeF(667.9998F, 23F);
             // 
             // dev_yj
             // 
-            this.dev_yj.LocationFloat = new DevExpress.Utils.PointFloat(10.0001F, 32.99993F);
+            this.dev_yj.LocationFloat = new DevExpress.Utils.PointFloat(110.0001F, 23.00002F);
             this.dev_yj.Multiline = true;
             this.dev_yj.Name = "dev_yj";
             this.dev_yj.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
-            this.dev_yj.SizeF = new System.Drawing.SizeF(667.9998F, 23F);
+            this.dev_yj.SizeF = new System.Drawing.SizeF(450F, 23F);
             this.dev_yj.StylePriority.UseTextAlignment = false;
             this.dev_yj.Text = "dev_yj";
             this.dev_yj.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter;
@@ -256,6 +268,8 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             // Detail
             // 
             this.Detail.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
+            this.xrLabel_size_IconQuestion_Subdivision,
+            this.xrChart_ParticelSizeSubdivision,
             this.xrPageBreak6,
             this.xrTb_ElementAnalysis,
             this.xrTable2,
@@ -269,10 +283,8 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             this.xrPageBreak4,
             this.xrTb_ElementAnalysisTable,
             this.xrPageBreak3,
-            this.xrLabel_size_IconQuestion_Subdivision,
             this.xrLabel_size_IconQuestion_Class,
             this.xrChart_ParticelSizeCalss,
-            this.xrChart_ParticelSizeSubdivision,
             this.xrPageBreak2,
             this.xrTa_ParticleSizeTable,
             this.xrTable1,
@@ -288,7 +300,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             this.dev_fbt,
             this.dev_zbt,
             this.xrPictureBox2});
-            this.Detail.HeightF = 4297.083F;
+            this.Detail.HeightF = 4296.916F;
             this.Detail.Name = "Detail";
             // 
             // xrPageBreak6
@@ -1680,7 +1692,7 @@ 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, 85, 73, 55);
             this.Version = "20.1";
             ((System.ComponentModel.ISupportInitialize)(this.xrTb_ElementAnalysis)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit();
@@ -1847,5 +1859,6 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
         private DevExpress.XtraReports.UI.XRTableRow xrTableRow23;
         private DevExpress.XtraReports.UI.XRTableCell xrTableCell31;
         private DevExpress.XtraReports.UI.XRPageBreak xrPageBreak6;
+        private DevExpress.XtraReports.UI.XRLabel xrLabel_pageinfo;
     }
 }

+ 87 - 57
OTSIncAReportApp/ReportTemplate/OTS_DEVReport.cs

@@ -160,7 +160,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
         /// 颗粒尺寸分析表
         /// </summary>
         /// <param name="TemplateClass"></param>
-        public void setParticleSizeTable()
+        public void setParticleSizeTable(bool a_pieSeriesClass,bool a_pieSeries)
         {
             //ElementSubscript subscript = new ElementSubscript();
             //    Export_ReportTemplate export_ReportTemplate = new Export_ReportTemplate(m_otsreport_export);
@@ -180,8 +180,8 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             xrTa_ParticleSizeTable.Visible = true;
             xrChart_ParticelSizeCalss.Visible = true;
             xrChart_ParticelSizeSubdivision.Visible = true;
-            xrLabel_size_IconQuestion_Class.Visible = true;
-            xrLabel_size_IconQuestion_Subdivision.Visible = true;
+            //xrLabel_size_IconQuestion_Class.Visible = true;
+            //xrLabel_size_IconQuestion_Subdivision.Visible = true;
             List<List<ParticleSizeDEVData>> list_ParticelSizeData = new List<List<ParticleSizeDEVData>>();
 
            
@@ -246,63 +246,77 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             }
 
             #region 大分类chart图
-
-            DataView dv = class_dt.DefaultView;
-            dv.Sort = "total DESC";
-            DataTable dt_class_dt = dv.ToTable();
-
-            // 实例化饼图对象
-            Series pieSeriesClass = new Series("颗粒尺寸大分类", ViewType.Pie);
-            pieSeriesClass.ArgumentScaleType = ScaleType.Qualitative;
-            // 项目名称
-            pieSeriesClass.ArgumentDataMember = "Class";
-            pieSeriesClass.ValueScaleType = ScaleType.Numerical;
-            //取值字段
-            pieSeriesClass.ValueDataMembers.AddRange(new string[] { "total" });
-            (pieSeriesClass.Label as PieSeriesLabel).Position = PieSeriesLabelPosition.Inside;
-            //显示百分比
-            pieSeriesClass.PointOptions.PointView = PointView.ArgumentAndValues; 
-            pieSeriesClass.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
-            //设置数据源
-            pieSeriesClass.DataSource = dt_class_dt;
-            pieSeriesClass.LabelsVisibility = DevExpress.Utils.DefaultBoolean.False;
-            // 饼图空间添加 新建的饼图对象
-            xrChart_ParticelSizeCalss.Series.Add(pieSeriesClass);
-            //右上角分组视图
-            this.xrChart_ParticelSizeCalss.Legend.MarkerSize = new System.Drawing.Size(20, 20);
-            this.xrChart_ParticelSizeCalss.Legend.TextOffset = 5;
-            this.xrChart_ParticelSizeCalss.Legend.VerticalIndent = 5;
-            this.xrChart_ParticelSizeCalss.Legend.Border.Color = Color.Red;//红色边框
+            if (a_pieSeriesClass)
+            {
+                xrLabel_size_IconQuestion_Class.Visible = true;
+                DataView dv = class_dt.DefaultView;
+                dv.Sort = "total DESC";
+                DataTable dt_class_dt = dv.ToTable();
+
+                // 实例化饼图对象
+                Series pieSeriesClass = new Series("颗粒尺寸大分类", ViewType.Pie);
+                pieSeriesClass.ArgumentScaleType = ScaleType.Qualitative;
+                // 项目名称
+                pieSeriesClass.ArgumentDataMember = "Class";
+                pieSeriesClass.ValueScaleType = ScaleType.Numerical;
+                //取值字段
+                pieSeriesClass.ValueDataMembers.AddRange(new string[] { "total" });
+                (pieSeriesClass.Label as PieSeriesLabel).Position = PieSeriesLabelPosition.Inside;
+                //显示百分比
+                pieSeriesClass.PointOptions.PointView = PointView.ArgumentAndValues;
+                pieSeriesClass.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
+                //设置数据源
+                pieSeriesClass.DataSource = dt_class_dt;
+                pieSeriesClass.LabelsVisibility = DevExpress.Utils.DefaultBoolean.False;
+                // 饼图空间添加 新建的饼图对象
+                xrChart_ParticelSizeCalss.Series.Add(pieSeriesClass);
+                //右上角分组视图
+                this.xrChart_ParticelSizeCalss.Legend.MarkerSize = new System.Drawing.Size(20, 20);
+                this.xrChart_ParticelSizeCalss.Legend.TextOffset = 5;
+                this.xrChart_ParticelSizeCalss.Legend.VerticalIndent = 5;
+                this.xrChart_ParticelSizeCalss.Legend.Border.Color = Color.Red;//红色边框
+            }
+         
             #endregion
             #region 细分chart图
+            if(a_pieSeries)
+            {
+                if (!a_pieSeriesClass)
+                {
+                    xrLabel_size_IconQuestion_Subdivision.LocationF = xrLabel_size_IconQuestion_Class.LocationF;
+                    
+                    xrChart_ParticelSizeSubdivision.LocationF = xrChart_ParticelSizeCalss.LocationF;
+                }
 
-            DataView dv2 = subdivde_dt.DefaultView;
-            dv2.Sort = "total DESC";
-            DataTable dt_subdivde_dt = dv2.ToTable();
-
-
-            // 实例化饼图对象
-            Series pieSeries = new Series("颗粒尺寸细化分类", ViewType.Pie);
-            pieSeries.ArgumentScaleType = ScaleType.Qualitative;
-            // 项目名称
-            pieSeries.ArgumentDataMember = "Name";
-            pieSeries.ValueScaleType = ScaleType.Numerical;
-            //取值字段
-            pieSeries.ValueDataMembers.AddRange(new string[] { "total" });
-            (pieSeries.Label as PieSeriesLabel).Position = PieSeriesLabelPosition.Inside;
-            //显示百分比
-            pieSeries.PointOptions.PointView = PointView.ArgumentAndValues;
-            pieSeries.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
-            //设置数据源
-            pieSeries.DataSource = dt_subdivde_dt;
-            pieSeries.LabelsVisibility = DevExpress.Utils.DefaultBoolean.False;
-            // 饼图空间添加 新建的饼图对象
-            xrChart_ParticelSizeSubdivision.Series.Add(pieSeries);
-            //右上角分组视图
-            this.xrChart_ParticelSizeSubdivision.Legend.MarkerSize = new System.Drawing.Size(20, 20);
-            this.xrChart_ParticelSizeSubdivision.Legend.TextOffset = 5;
-            this.xrChart_ParticelSizeSubdivision.Legend.VerticalIndent = 5;
-            this.xrChart_ParticelSizeSubdivision.Legend.Border.Color = Color.Red;//红色边框
+                xrLabel_size_IconQuestion_Subdivision.Visible = true;
+                DataView dv2 = subdivde_dt.DefaultView;
+                dv2.Sort = "total DESC";
+                DataTable dt_subdivde_dt = dv2.ToTable();
+
+                // 实例化饼图对象
+                Series pieSeries = new Series("颗粒尺寸细化分类", ViewType.Pie);
+                pieSeries.ArgumentScaleType = ScaleType.Qualitative;
+                // 项目名称
+                pieSeries.ArgumentDataMember = "Name";
+                pieSeries.ValueScaleType = ScaleType.Numerical;
+                //取值字段
+                pieSeries.ValueDataMembers.AddRange(new string[] { "total" });
+                (pieSeries.Label as PieSeriesLabel).Position = PieSeriesLabelPosition.Inside;
+                //显示百分比
+                pieSeries.PointOptions.PointView = PointView.ArgumentAndValues;
+                pieSeries.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
+                //设置数据源
+                pieSeries.DataSource = dt_subdivde_dt;
+                pieSeries.LabelsVisibility = DevExpress.Utils.DefaultBoolean.False;
+                // 饼图空间添加 新建的饼图对象
+                xrChart_ParticelSizeSubdivision.Series.Add(pieSeries);
+                //右上角分组视图
+                this.xrChart_ParticelSizeSubdivision.Legend.MarkerSize = new System.Drawing.Size(20, 20);
+                this.xrChart_ParticelSizeSubdivision.Legend.TextOffset = 5;
+                this.xrChart_ParticelSizeSubdivision.Legend.VerticalIndent = 5;
+                this.xrChart_ParticelSizeSubdivision.Legend.Border.Color = Color.Red;//红色边框
+            }
+          
             #endregion
             #endregion
         }
@@ -1330,7 +1344,23 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             Template.Font= new Font(Schriftart_english, 12f);
             return Template;
         }
+
         #endregion
+
+        private void xrLabel_pageinfo_PrintOnPage(object sender, PrintOnPageEventArgs e)
+        {
+            int pagecount = e.PageCount;
+            int pageindex = e.PageIndex;
+            if (pageindex < 1)
+            {
+                this.xrLabel_pageinfo.Visible = false;
+            }
+            else
+            {
+                this.xrLabel_pageinfo.Visible = true;
+                this.xrLabel_pageinfo.Text = string.Format("第{0}页,共{1}页", pageindex , pagecount - 1);
+            }
+        }
     }
 
     public class ParticleSizeDEVData