Browse Source

报告程序默认优化(1)

zhangjiaxin 1 year ago
parent
commit
a6cdee949d

+ 2 - 2
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/ParticleAnalysis.cs

@@ -234,7 +234,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
         /// 分类整合大小分类都有
         /// </summary>
         /// <returns></returns>
-        public List<DataTable>  GetClassificationConsolidationTable(c_TemplateClass m_mbszclass, OTSReport_Export m_otsreport_export, string ComputeMode)
+        public List<DataTable>  GetClassificationConsolidationTable(c_TemplateClass m_mbszclass, OTSReport_Export m_otsreport_export, string ComputeMode, string a_PartSizeFile)
         {
             List<DataTable> datas = new List<DataTable>();
 
@@ -243,7 +243,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
             List<string> colid = new List<string>();
             //获取粒级表
             string path1 = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFileFolder +
-                 m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFile;
+                 a_PartSizeFile;
             DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXml(path1);
             string sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
 

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

@@ -204,7 +204,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                     Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectLeft"]), Y = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectTop"]), Width = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectWidth"]), Height = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectHeight"]) };
                     Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
                     Bitmap bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
-                    bp_particle = imageProcessor.ResizeImageWithPadding(bp_particle, 120, 120, Color.Black);
+                    bp_particle = imageProcessor.ResizeImageWithPadding(bp_particle, 120, 120, Color.White);
                     bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i_row]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString() };
                     //获取该颗粒的xray能谱图像
                     DataTable DT_XR = ExportXRay(str_fieldid, str_particleid, fielddata);

+ 6 - 6
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/TernaryDiagram.cs

@@ -26,7 +26,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
         frmReportConditionChoose m_condition;
         public int condition = -1;
         //绘制图例
-        public Bitmap DrawATernaryDiagramLegend(List<Color> Color_list, OTSReport_Export m_otsreport_export, c_TemplateClass m_mbszclass)
+        public Bitmap DrawATernaryDiagramLegend(List<Color> Color_list, OTSReport_Export m_otsreport_export, string a_PartSizeFile)
         {
             Bitmap map = new Bitmap(260, 115);
             Graphics g = Graphics.FromImage(map);
@@ -44,7 +44,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
             //设置标签名称
             List<string> listName = new List<string>();
             //获取粒级表
-            string pathe = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFileFolder + m_mbszclass.M_SYXT.str_cb_syxt_ljb.ToString();
+            string pathe = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.PartSizeFileFolder + a_PartSizeFile;
             DataSet ds = XMLoperate.GetXml(pathe);
             string sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
 
@@ -92,9 +92,9 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
             return map;
         }
 
-        public Bitmap DrawATernaryPicture(int selectindex, c_TemplateClass m_mbszclass, List<Color> Color_list,OTSReport_Export m_otsreport_export)
+        public Bitmap DrawATernaryPicture(int selectindex, c_TemplateClass m_mbszclass, List<Color> Color_list,OTSReport_Export m_otsreport_export,string a_PartSizeFile)
         {
-            initialization(m_otsreport_export);
+            initialization(m_otsreport_export, a_PartSizeFile);
           
           
 
@@ -235,10 +235,10 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
             return map;
         }
 
-        private void initialization(OTSReport_Export m_otsreport_export)
+        private void initialization(OTSReport_Export m_otsreport_export,string a_PartSizeFile)
         {
             //加载三元相图各项
-            string pathtpf = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.TrigTemplateFileFolder + "\\" + m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.TriTempFile;// Application.StartupPath + "\\Config\\ProData\\DefaultTriTemplateFile.tpf";
+            string pathtpf = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_RptConfigFile.TrigTemplateFileFolder + "\\" + a_PartSizeFile;// Application.StartupPath + "\\Config\\ProData\\DefaultTriTemplateFile.tpf";
             TemplateList = new List<string>();
             DataSet ds = DataOperation.DataAccess.XMLoperate.GetXmlData(pathtpf, "XMLData");
             DataTable dt = ds.Tables["Member"];

+ 46 - 3
OTSIncAReportApp/1-UI/OTSReportExport/Template/DataTemplate.cs

@@ -2,6 +2,8 @@
 using DevExpress.XtraCharts;
 using DevExpress.XtraPrinting.Drawing;
 using DevExpress.XtraReports.UI;
+using OTSCommon;
+using OTSCommon.Model;
 using OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration;
 using OTSIncAReportApp.OTSSampleReportInfo;
 using OTSIncAReportApp.OTSTemplateDesigner;
@@ -10,6 +12,7 @@ using System;
 using System.Collections.Generic;
 using System.Data;
 using System.Drawing;
+using System.Windows.Forms;
 using static OTSIncAReportApp.OTSReport_Export;
 
 namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
@@ -29,6 +32,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
         DataTable languageData = new DataTable();
         private string ComputeMode = "";//计算方式
         private string ComputeModeName = "";//计算方式
+        private string PartSizeFile = "";//粒级文件
 
         public OTS_DEVReport(OTSReport_Export in_export, c_TemplateClass a_Template, frmReportApp a_frmReportApp)
         {
@@ -48,8 +52,47 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
                 }
             }
 
-            string con = a_frmReportApp.m_conditionChoose.m_conditionData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE).ToString();
+            //string con = a_frmReportApp.m_conditionChoose.m_conditionData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE).ToString();
+            string con = "";
+            DataSet ds1 = XMLoperate.GetXmlData(Application.StartupPath + RptConfigFile.m_ReportMgrParamFile, "XMLData");
+            DataTable dt1 = ds1.Tables["Member"];
             string po = "";
+
+
+            foreach (DataRow element in dt1.Rows)
+            {
+                string RegName = element["RegName"].ToString();
+
+                if (RegName == "PartSizeFile")
+                {
+                    PartSizeFile = element["name"].ToString();
+                    //comboBox_PartiSizeFileFolder.SelectedIndex = comboBox_PartiSizeFileFolder.Items.IndexOf(element["name"].ToString());
+                }
+
+                if (RegName == "TRIO_CHART_TYPE")
+                {
+                    po = element["strValue"].ToString();
+                    //cB_sjtmbwj.SelectedIndex = cB_sjtmbwj.Items.IndexOf(element["strValue"].ToString());
+                }
+                if (RegName == "SIZE_CAL_METHOD_TYPE")
+                {
+                    po = element["strValue"].ToString();
+                    //cB_SIZE_CAL_METHOD_TYPE.SelectedIndex = cB_SIZE_CAL_METHOD_TYPE.Items.IndexOf(element["strValue"].ToString());
+                }
+            }
+
+
+
+
+            for (int i=0;i< dt1.Rows.Count;i++)
+            {
+                if (dt1.Rows[i]["RegName"].ToString()== "SIZE_CAL_METHOD_TYPE")
+                {
+                    con = dt1.Rows[i]["strValue"].ToString();
+                }
+            }
+         
+                
             switch (con)
             {
                 case "DMAX":
@@ -487,7 +530,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
         {
             xrPageBreak1.Visible = true;
             ParticleAnalysis particleList = new ParticleAnalysis();
-            List<DataTable> CompositeData = particleList.GetClassificationConsolidationTable(TemplateClass, m_otsreport_export, ComputeMode);
+            List<DataTable> CompositeData = particleList.GetClassificationConsolidationTable(TemplateClass, m_otsreport_export, ComputeMode, PartSizeFile);
             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);
@@ -1574,7 +1617,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             xRPicture_legend.LocationF = new PointF(400f, NeueStartposition);
             xRPicture_legend.SizeF = new SizeF(260f, 120f);
             xRPicture_legend.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage;
-            ImageSource imageSource_legend = new ImageSource(ternaryDiagram.DrawATernaryDiagramLegend(Color_list,m_otsreport_export, TemplateClass));
+            ImageSource imageSource_legend = new ImageSource(ternaryDiagram.DrawATernaryDiagramLegend(Color_list,m_otsreport_export, PartSizeFile));
             xRPicture_legend.ImageSource = imageSource_legend;
             NeueStartposition = xRPicture_legend.LocationF.Y + xRPicture_legend.SizeF.Height;
             return xRPicture_legend;