Ver código fonte

临时提交

zhangjiaxin 3 anos atrás
pai
commit
98e69983de

+ 149 - 0
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage.cs

@@ -2158,6 +2158,155 @@ namespace OTSIncAReportGrids
             else
                 return "";
         }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="str_resultPath"></param>
+        /// <param name="dataTable"></param>
+        /// <param name="vs"></param>
+        /// <param name="dt_FIeld"></param>
+        public void Out_MarkParticleRectangleOnFieldFile(string str_resultPath, DataTable dataTable, out List<string> vs, out DataTable dt_FIeld)
+        {
+            Init();
+
+            List<string> maxlength = new List<string>();
+            for (int i = 0; i < dataTable.Rows.Count; i++)
+            {
+                if (dataTable.Rows[i]["TypeName"].ToString() != "Not Identified")
+                {
+                    if (maxlength.Count < 10)
+                    {
+                        maxlength.Add(dataTable.Rows[i]["Fieldid"].ToString());
+                    }
+                    else
+                    {
+                        break;
+                    }
+                }
+            }
+            List<string> max_list = maxlength.Distinct().ToList();
+
+            string str_path_FIELD_FILES = str_resultPath + "\\FIELD_FILES\\";
+            int intQuantity = 0;
+            dt_FIeld = new DataTable();
+            vs = new List<string>();
+
+
+            //查找该field下对应所有的颗粒
+            DataTable dt_AllParticle = fieldData.GetAllParticle_DataTable();
+
+            DirectoryInfo theFolder = new DirectoryInfo(str_path_FIELD_FILES);
+            if (theFolder.Exists)
+            {
+                DataTable dt = new DataTable();
+                dt.Columns.Add("fieldid");
+                dt.Columns.Add("id");
+                dt.Columns.Add("fieldName");
+                dt.Columns.Add("cunt", typeof(int));
+                dt.Columns.Add("fieldFullName");
+                for (int i = 0; i < max_list.Count; i++)
+                {
+                    foreach (FileInfo nextifile in theFolder.GetFiles())
+                    {
+                        if (nextifile.Name.Contains(".bmp") == true || nextifile.Name.Contains(".BMP") == true)
+                        {
+                            //确认对应的帧图名
+                            string str_fieldid = Path.GetFileNameWithoutExtension(nextifile.Name);
+                            str_fieldid = str_fieldid.Substring(5, str_fieldid.Length - 5);//减去field字符长度
+                            bool bl = false;
+
+                            if (str_fieldid == max_list[i].ToString())
+                            {
+                                bl = true;
+                            }
+
+                            if (bl)
+                            {
+                                DataRow dr = dt.NewRow();
+                                dr["fieldid"] = " fieldid = " + str_fieldid;
+                                dr["cunt"] = dataTable.Select(" fieldid = " + str_fieldid).Count();
+                                dr["fieldName"] = nextifile.Name;
+                                dr["fieldFullName"] = nextifile.FullName;
+                                dr["id"] = str_fieldid;
+                                dt.Rows.Add(dr);
+                            }
+
+                        }
+                    }
+                }
+                dt_FIeld = dt.Copy();
+                dt_FIeld.Columns.Add("Field_pic", typeof(Bitmap));
+
+                for (int i = 0; i < dt_FIeld.Rows.Count; i++)
+                {
+                    if (dataTable.Select(dt_FIeld.Rows[i]["fieldid"].ToString()).Count() > 0)
+                    {
+                        vs.Add(dt_FIeld.Rows[i]["id"].ToString());
+
+                        Image img = Image.FromFile(dt_FIeld.Rows[i]["fieldFullName"].ToString());
+                        //img.Save(@"D:\1.bmp");
+                        Bitmap ls_fieldbp = new Bitmap(img.Width, img.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
+
+                        using (Graphics g = Graphics.FromImage(ls_fieldbp))
+                        {
+                            g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
+                            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
+                            g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
+                            g.DrawImage(img, new Rectangle(0, 0, img.Width, img.Height));
+                        }
+                        //ls_fieldbp.Save(@"D:\1.bmp");
+                        img.Dispose();
+                        img = null;
+
+
+                        //循环将颗粒,进行标记到bitmap图上
+                        DataRow[] drlist = dt_AllParticle.Select(dt_FIeld.Rows[i]["fieldid"].ToString());
+                        if (drlist.Count() > 0)
+                            intQuantity = intQuantity + 1;
+                        for (int i_row = 0; i_row < drlist.Count(); i_row++)
+                        {
+                            //string str_fieldid = drlist[i_row]["fieldid"].ToString();
+                            string str_particleid = drlist[i_row]["particleid"].ToString();
+                            string str_stdtypeid = drlist[i_row]["typeid"].ToString();
+                            string str_offset_rect_X = drlist[i_row]["RectLeft"].ToString();
+                            string str_offset_rect_Y = drlist[i_row]["RectTop"].ToString();
+                            string str_offset_rect_Width = drlist[i_row]["RectWidth"].ToString();
+                            string str_offset_rect_Height = drlist[i_row]["RectHeight"].ToString();
+
+                            //确定需要标记颗粒的定位
+                            Rectangle offset_rect = new Rectangle(Convert.ToInt32(str_offset_rect_X), Convert.ToInt32(str_offset_rect_Y),
+                    Convert.ToInt32(str_offset_rect_Width), Convert.ToInt32(str_offset_rect_Height));
+
+                            //向帧图进行标记颗粒位置
+                            Graphics g = Graphics.FromImage(ls_fieldbp);
+                            g.DrawRectangle(new Pen(Color.Aquamarine), offset_rect);
+
+                            //判断是否超出了图像外面,是的话,让文字在左侧显示,默认在右侧显示
+                            int ls_offsetx = offset_rect.X + offset_rect.Width;
+                            if (ls_offsetx > ls_fieldbp.Width - 10)
+                            {
+                                ls_offsetx = offset_rect.X - 10;
+                            }
+
+                            g.DrawString(dt_FIeld.Rows[i]["id"].ToString() + "" + str_particleid.ToString(),
+                                new Font("黑体", 8), new SolidBrush(Color.Aqua), new PointF(ls_offsetx, offset_rect.Y));
+
+                            dt_FIeld.Rows[i]["Field_pic"] = ls_fieldbp;
+
+                            //保存带有标记的帧图
+                            //ls_fieldbp.Save(str_path_FIELD_FILES_MARK + dt_FIeld.Rows[i]["id"].ToString() + ".bmp");
+
+                            //ls_fieldbp.Dispose();
+                        }
+                    }
+                }
+
+            }
+            //
+            GC.Collect();
+            GC.WaitForPendingFinalizers();
+        }
     }
 
 

+ 1143 - 2
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -2409,7 +2409,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             }
 
             //循环6次,得到最大的6个元素信息
-            for (int geti = 0; geti < 6; geti++)
+            for (int geti = 0; geti < 11; geti++)
             {
                 double max_elementvalue = -1;
                 string max_elementname = "";
@@ -2488,9 +2488,1150 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
 
 
+        //-------------------------------------------------dev----------------------------------------------------------
+        /// <summary>
+        /// DEV颗粒列表颗粒前20个谱图排序
+        /// </summary>
+        /// <param name="m_mbszclass"></param>
+        /// <returns></returns>
+        public DataTable Get_dev_kllb_data(MBSZClass m_mbszclass)
+        {
+            int serialNumber = 1;
+            //------------------加载模块,获取数据-------------------------------------------------
+            m_otsreport_export.m_ReportApp.im_ParticlesGridDevidePage = new ParticlesGridDevidePage(m_otsreport_export.m_ReportApp);
+            DataTable SelectParticleTable = new DataTable();
+            SelectParticleData(out SelectParticleTable);
+            int sel = 0;
+            if (m_mbszclass.M_SY.int_xzkl == 0)
+            {
+                sel = 0;
+            }
+            else
+            {
+                sel = 1;
+            }
+            //根据sql条件,查询获取颗粒信息数据
+            ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
+            DataTable dt = InvalidRemoval(fielddata.GetIncaSurfaceData(SelectParticleTable, sel), "TypeName");
+            ResultFile resfile = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()];
+            string str_libraryName = ((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)resfile.ResultInfo["Sample"])["Members"])["MsrParams"])["STDName"].ToString();
+            if (m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString() == "Hardness")
+            {
+                dt.Columns.Add("Hardness", typeof(double));
+                dt.Columns.Add("Hardness_detailed");
+                if (DoesDBexist())
+                {
+                    DataTable dt_stl = new DataTable();
+                    GetSTL(str_libraryName, out dt_stl);
+                    for (int i = 0; i < dt.Rows.Count; i++)
+                    {
+                        for (int a = 0; a < dt_stl.Rows.Count; a++)
+                        {
+                            if (dt.Rows[i]["TypeName"].ToString() == dt_stl.Rows[a]["TypeId"].ToString())
+                            {
+                                dt.Rows[i]["Hardness"] = Convert.ToDouble(dt_stl.Rows[a]["Hardness"]);
+                                dt.Rows[i]["Hardness_detailed"] = dt_stl.Rows[a]["Hardness_detailed"];
+                                break;
+                            }
+                        }
+                    }
+                }
+
+            }
+
+            //将颗粒大小排序(从大到小)
+            DataView dv = dt.DefaultView;
+            dv.Sort = m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString() + " DESC";
+            DataTable dt_ParticlesGridDevidePage = dv.ToTable();
+
+            string str_resultPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath;
+            //------------------加载模块,获取数据结束----------------------------------------------
+            #region 创建要插入数据库表结构
+            //插入模板需父子表,结构
+            //表名field_dt表:(父表)           帧图表
+            DataTable DT_field_dt = new DataTable();
+            DT_field_dt.TableName = "field_dt";
+            DataColumn colpictid2 = new DataColumn("FieldId");
+            colpictid2.DataType = typeof(int);
+            DT_field_dt.Columns.Add(colpictid2);
+            //图像列
+            DataColumn colpict2 = new DataColumn("FieldImg");
+            colpict2.DataType = System.Type.GetType("System.Byte[]");
+            DT_field_dt.Columns.Add(colpict2);
+
+            //largest20表:(无关系表)       需要显示前20条带有显示能谱图像的颗粒表
+            DataTable DT_Largest20 = new DataTable();
+            DT_Largest20.TableName = "Largest20";
+            DT_Largest20.Columns.Add("pid");
+            DT_Largest20.Columns.Add("Size");
+            DT_Largest20.Columns.Add("Width");
+            DT_Largest20.Columns.Add("DMAX");
+            DT_Largest20.Columns.Add("DMIN");
+            DT_Largest20.Columns.Add("Class");
+            DT_Largest20.Columns.Add("ColName1");
+            DT_Largest20.Columns.Add("ColName2");
+            DT_Largest20.Columns.Add("ColName3");
+            DT_Largest20.Columns.Add("ColName4");
+            DT_Largest20.Columns.Add("ColName5");
+            DT_Largest20.Columns.Add("ColName6");
+            DT_Largest20.Columns.Add("ColName7");
+            DT_Largest20.Columns.Add("ColName8");
+            DT_Largest20.Columns.Add("ColName9");
+            DT_Largest20.Columns.Add("ColName10");
+            DT_Largest20.Columns.Add("ColVal1");
+            DT_Largest20.Columns.Add("ColVal2");
+            DT_Largest20.Columns.Add("ColVal3");
+            DT_Largest20.Columns.Add("ColVal4");
+            DT_Largest20.Columns.Add("ColVal5");
+            DT_Largest20.Columns.Add("ColVal6");
+            DT_Largest20.Columns.Add("ColVal7");
+            DT_Largest20.Columns.Add("ColVal8");
+            DT_Largest20.Columns.Add("ColVal9");
+            DT_Largest20.Columns.Add("ColVal10");
+            // 图像列
+            DT_Largest20.Columns.Add("p1", typeof(Bitmap));
+            DT_Largest20.Columns.Add("p2", typeof(Bitmap));
+            DT_Largest20.Columns.Add("p3", typeof(Bitmap));
+
+            #endregion
+
+            #region 插入-前20颗粒部份
+
+            for (int i_row = 0; i_row < dt_ParticlesGridDevidePage.Rows.Count; i_row++)
+            {
+                if (dt_ParticlesGridDevidePage.Rows[i_row].ItemArray[24].ToString() != "Not Identified")
+                {
+                    //获取颗粒的fieldid,和particleid
+                    string str_fieldid = dt_ParticlesGridDevidePage.Rows[i_row]["fieldid"].ToString();
+                    string str_particleid = dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
+                    //string str_subparticles = dt_ParticlesGridDevidePage.Rows[i_row]["SubParticles"].ToString();
+                    string str_typeid = dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString();
+                    string str_typename = dt_ParticlesGridDevidePage.Rows[i_row]["TypeName"].ToString();
+                    string str_element = dt_ParticlesGridDevidePage.Rows[i_row]["Element"].ToString();
+
+                    //获取原始颗粒图像
+                    Bitmap bp_particle = new Bitmap(1, 1);
+                    string str_path = str_resultPath + "\\FIELD_FILES\\";
+                    string str_imagePath = str_path + "Field" + str_fieldid.ToString() + ".bmp";
+
+                    if (str_fieldid == "-1")
+                        continue;
+
+                    if (serialNumber > 20)
+                        continue;
+
+                    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);
+                    bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
+                    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能谱图像
+                    System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
+                            str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
+                    Bitmap ls_xraybpnew = new Bitmap(1, 1);
+                    ls_xraybpnew = OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(bp_xraybp, 700, 115);//能谱图处理
+
+                    //获取该颗粒的二次放大处理图像
+                    Bitmap ls_processbitmap = new Bitmap(1, 1);
+                    ls_processbitmap = OTSIncAReportGraph.Class.DrawFunction.GetReZoomBitmap(bp_particle);// (Bitmap)bp_particle.Clone();//待完善
+
+                    //再将图像转成二进制流-------------------------------------------------------------------
+                    //原图
+                    MemoryStream newms_p1 = new MemoryStream();
+                    bp_particle.Save(newms_p1, System.Drawing.Imaging.ImageFormat.Bmp);
+
+                    //二次放大图
+                    MemoryStream newms_p2 = new MemoryStream();
+                    ls_processbitmap.Save(newms_p2, System.Drawing.Imaging.ImageFormat.Bmp);
+
+                    //能谱图
+                    MemoryStream newms_p3 = new MemoryStream();
+                    ls_xraybpnew.Save(newms_p3, System.Drawing.Imaging.ImageFormat.Bmp);
+
+                    //---------------------------------------------------------------------------------------                  
+                    DataRow dr = DT_Largest20.NewRow();
+
+                    dr["p1"] = bp_particle;
+                    dr["p2"] = ls_processbitmap;
+                    dr["p3"] = ls_xraybpnew;
+                    newms_p1.Dispose();
+                    newms_p2.Dispose();
+                    newms_p3.Dispose();
+
+                    dr["pid"] = serialNumber++.ToString();
+                    //颗粒列表列中第一个可选参数
+                    dr["Size"] = datatable_data(dt_ParticlesGridDevidePage, i_row, m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1);
+                    //这个参数没有用
+                    dr["Width"] = dt_ParticlesGridDevidePage.Rows[i_row]["rectwidth"].ToString();
+                    //颗粒列表列中第二个可选参数
+                    dr["DMAX"] = datatable_data(dt_ParticlesGridDevidePage, i_row, m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p2);
+                    //颗粒列表列中第三个可选参数
+                    dr["DMIN"] = datatable_data(dt_ParticlesGridDevidePage, i_row, m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p3);
+                    //颗粒列表列中显示分类不可以选择
+                    dr["Class"] = dt_ParticlesGridDevidePage.Rows[i_row]["typename"].ToString();
+
+                    GetMaxElementFromDataTable(dt_ParticlesGridDevidePage, i_row, out List<string> list_max_elementname, out List<double> list_max_elementvale);
+                    //元素1
+                    dr["ColName1"] = list_max_elementname[0];
+                    dr["ColVal1"] = list_max_elementvale[0].ToString();
+                    //元素2
+                    dr["ColName2"] = list_max_elementname[1];
+                    dr["ColVal2"] = list_max_elementvale[1].ToString();
+                    //元素3
+                    dr["ColName3"] = list_max_elementname[2];
+                    dr["ColVal3"] = list_max_elementvale[2].ToString();
+                    //元素4
+                    dr["ColName4"] = list_max_elementname[3];
+                    dr["ColVal4"] = list_max_elementvale[3].ToString();
+                    //元素5
+                    dr["ColName5"] = list_max_elementname[4];
+                    dr["ColVal5"] = list_max_elementvale[4].ToString();
+                    //元素6
+                    dr["ColName6"] = list_max_elementname[5];
+                    dr["ColVal6"] = list_max_elementvale[5].ToString();
+                    //元素7
+                    dr["ColName7"] = list_max_elementname[7];
+                    dr["ColVal7"] = list_max_elementvale[7].ToString();
+                    //元素8
+                    dr["ColName8"] = list_max_elementname[8];
+                    dr["ColVal8"] = list_max_elementvale[8].ToString();
+                    //元素6
+                    dr["ColName9"] = list_max_elementname[9];
+                    dr["ColVal9"] = list_max_elementvale[9].ToString();
+                    //元素6
+                    dr["ColName9"] = list_max_elementname[10];
+                    dr["ColVal9"] = list_max_elementvale[10].ToString();
+
+                    DT_Largest20.Rows.Add(dr);
+                }
+            }
+            #endregion
+            return DT_Largest20;
+        }
+
+        public void Get_dev_kllb_data_frame(MBSZClass m_mbszclass, out DataTable file_pic, out List<DataTable> list_dt)
+        {
+
+            //------------------加载模块,获取数据-------------------------------------------------
+            m_otsreport_export.m_ReportApp.im_ParticlesGridDevidePage = new ParticlesGridDevidePage(m_otsreport_export.m_ReportApp);
+
+            SelectParticleData(out DataTable SelectParticleTable);
+            int sel = 0;
+            if (m_mbszclass.M_SY.int_xzkl == 0)
+            {
+                sel = 0;
+            }
+            else
+            {
+                sel = 1;
+            }
+            //根据sql条件,查询获取颗粒信息数据
+            ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
+            DataTable dt = InvalidRemoval(fielddata.GetIncaSurfaceData(SelectParticleTable, sel), "TypeName");
+            ResultFile resfile = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()];
+            string str_libraryName = ((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)resfile.ResultInfo["Sample"])["Members"])["MsrParams"])["STDName"].ToString();
+            if (m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString() == "Hardness")
+            {
+                dt.Columns.Add("Hardness", typeof(double));
+                dt.Columns.Add("Hardness_detailed");
+                if (DoesDBexist())
+                {
+                    DataTable dt_stl = new DataTable();
+                    GetSTL(str_libraryName, out dt_stl);
+                    for (int i = 0; i < dt.Rows.Count; i++)
+                    {
+                        for (int a = 0; a < dt_stl.Rows.Count; a++)
+                        {
+                            if (dt.Rows[i]["TypeName"].ToString() == dt_stl.Rows[a]["TypeId"].ToString())
+                            {
+                                dt.Rows[i]["Hardness"] = Convert.ToDouble(dt_stl.Rows[a]["Hardness"]);
+                                dt.Rows[i]["Hardness_detailed"] = dt_stl.Rows[a]["Hardness_detailed"];
+                                break;
+                            }
+                        }
+                    }
+                }
+            }
+            //将颗粒大小排序(从大到小)
+            DataView dv = dt.DefaultView;
+            dv.Sort = m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString() + " DESC";
+            DataTable dt_ParticlesGridDevidePage = dv.ToTable();
+            string str_resultPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath;
+
+            DataTable DT_field_dt = new DataTable();
+            DT_field_dt.TableName = "field_dt";
+            DT_field_dt.Columns.Add("FieldId", typeof(int));
+            //图像列
+            DT_field_dt.Columns.Add("FieldImg", typeof(Bitmap));
+
+            //首先生成标记颗粒的帧图图像文件
+            DataTable dt_GridDevidePage = dt_ParticlesGridDevidePage.Copy();
+            dt_GridDevidePage.Clear();
+            for (int i = 0; i < dt_ParticlesGridDevidePage.Rows.Count; i++)
+            {
+                if (dt_ParticlesGridDevidePage.Rows[i]["TypeName"].ToString() != "Not Identified")
+                {
+                    dt_GridDevidePage.Rows.Add(dt_ParticlesGridDevidePage.Rows[i].ItemArray);
+                }
+            }
+            m_otsreport_export.m_ReportApp.im_ParticlesGridDevidePage.Out_MarkParticleRectangleOnFieldFile(str_resultPath, dt_GridDevidePage, out List<string> vs, out DataTable data);
+            FrameGraphParticleTableDatat(dt_ParticlesGridDevidePage, fielddata, data, m_mbszclass, out DataTable data_A);
+
+            List<DataTable> listData = new List<DataTable>();
+            for (int i = 0; i < data.Rows.Count; i++)
+            {
+                DataTable dataTable = data_A.Clone();
+                //在数据表中有颗粒在该帧图中的话,则对该帧图标记图像进行读取存入数据库
+                DataRow[] datarowlist = data_A.Select(data.Rows[i]["fieldid"].ToString());
+                if (datarowlist.Count() > 0)
+                {
+                    for (int a = 0; a < data_A.Rows.Count; a++)
+                    {
+                        if (data.Rows[i]["id"].ToString() == data_A.Rows[a]["FieldId"].ToString())
+                        {
+                            dataTable.Rows.Add(data_A.Rows[a].ItemArray);
+                        }
+                    }
+                    listData.Add(dataTable);
+                }
+            }
+
+            file_pic = data.Copy();
+            list_dt = listData;
+        }
+
+        private void FrameGraphParticleTableDatat(DataTable dt_ParticlesGridDevidePage, ParticleData fielddata, DataTable DT_field_dt, MBSZClass m_mbszclass, out DataTable data_A)
+        {
+            //将颗粒大小排序(从大到小)
+            DataView dv = dt_ParticlesGridDevidePage.DefaultView;
+            dv.Sort = m_mbszclass.M_KLLBXX.str_cb_kllb_chartSort_p1.ToString() + " DESC";
+            DataTable dt = dv.ToTable();
+            //表名Largest_frame表:(子表)       显示20条颗粒除外的部份颗粒信息
+            DataTable FrameGraphSubTable = new DataTable();
+            FrameGraphSubTable.TableName = "FrameGraphSubTable";
+            FrameGraphSubTable.Columns.Add("pid");
+            FrameGraphSubTable.Columns.Add("Size");
+            FrameGraphSubTable.Columns.Add("Width");
+            FrameGraphSubTable.Columns.Add("DMAX");
+            FrameGraphSubTable.Columns.Add("DMIN");
+            FrameGraphSubTable.Columns.Add("Class");
+            FrameGraphSubTable.Columns.Add("ColName1");
+            FrameGraphSubTable.Columns.Add("ColName2");
+            FrameGraphSubTable.Columns.Add("ColName3");
+            FrameGraphSubTable.Columns.Add("ColName4");
+            FrameGraphSubTable.Columns.Add("ColName5");
+            FrameGraphSubTable.Columns.Add("ColName6");
+            FrameGraphSubTable.Columns.Add("ColName7");
+            FrameGraphSubTable.Columns.Add("ColName8");
+            FrameGraphSubTable.Columns.Add("ColName9");
+            FrameGraphSubTable.Columns.Add("ColName10");
+            FrameGraphSubTable.Columns.Add("ColVal1");
+            FrameGraphSubTable.Columns.Add("ColVal2");
+            FrameGraphSubTable.Columns.Add("ColVal3");
+            FrameGraphSubTable.Columns.Add("ColVal4");
+            FrameGraphSubTable.Columns.Add("ColVal5");
+            FrameGraphSubTable.Columns.Add("ColVal6");
+            FrameGraphSubTable.Columns.Add("ColVal7");
+            FrameGraphSubTable.Columns.Add("ColVal8");
+            FrameGraphSubTable.Columns.Add("ColVal9");
+            FrameGraphSubTable.Columns.Add("ColVal10");
+            FrameGraphSubTable.Columns.Add("pic", typeof(Bitmap));
+
+            FrameGraphSubTable.Columns.Add("FieldId", typeof(int));
+
+
+            for (int i_row = 0; i_row < dt.Rows.Count; i_row++)
+            {
+                if (dt.Rows[i_row]["element"].ToString() == "")
+                    continue;
+                if (dt.Rows[i_row]["TypeName"].ToString() == "Not Identified")
+                    continue;
+                string str_fieldid = dt.Rows[i_row]["fieldid"].ToString();
+                if (JudgeWhetherItExists(Convert.ToInt32(str_fieldid), DT_field_dt, "id"))
+                {
+                    //获取原始颗粒图像
+                    Bitmap bp_particle = new Bitmap(1, 1);
+                    Bitmap bp_field = new Bitmap(1, 1);
+                    Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt.Rows[i_row]["RectLeft"]), Y = Convert.ToInt32(dt.Rows[i_row]["RectTop"]), Width = Convert.ToInt32(dt.Rows[i_row]["RectWidth"]), Height = Convert.ToInt32(dt.Rows[i_row]["RectHeight"]) };
+
+                    for (int i = 0; i < DT_field_dt.Rows.Count; i++)
+                    {
+                        if (dt.Rows[i_row]["FieldId"].ToString() == DT_field_dt.Rows[i]["id"].ToString())
+                        {
+                            bp_field = new Bitmap(DT_field_dt.Rows[i]["fieldFullName"].ToString());
+
+                        }
+                    }
+
+                    bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
+                    bp_particle.Tag = new List<string>() { dt.Rows[i_row]["FieldId"].ToString(), dt.Rows[i_row]["ParticleId"].ToString(), dt.Rows[i_row]["TypeId"].ToString() };
+
+                    DataRow dr = FrameGraphSubTable.NewRow();
+
+                    dr["pic"] = bp_particle;
+                    //帧图列表列第一个字段的可选参数
+                    dr["pid"] = datatable_data(dt, i_row, m_mbszclass.M_KLLBXX.str_cb_kllb_chartSort_p1);
+                    //帧图列表列第二个字段的可选参数
+                    dr["Size"] = datatable_data(dt, i_row, m_mbszclass.M_KLLBXX.str_cb_kllb_chartSort_p2);
+
+
+                    dr["Width"] = dt.Rows[i_row]["rectwidth"].ToString();
+
+                    dr["DMAX"] = Math.Round(Convert.ToDouble(dt.Rows[i_row]["dmax"]), 2).ToString();
+                    dr["DMIN"] = Math.Round(Convert.ToDouble(dt.Rows[i_row]["dmin"]), 2).ToString();
+                    dr["Class"] = dt.Rows[i_row]["typename"].ToString();
+
+                    dr["fieldid"] = str_fieldid;
+
+
+                    GetMaxElementFromDataTable(dt, i_row, out List<string> list_max_elementname, out List<double> list_max_elementvale);
+                    //元素1
+                    dr["ColName1"] = list_max_elementname[0];
+                    dr["ColVal1"] = list_max_elementvale[0].ToString();
+                    //元素2
+                    dr["ColName2"] = list_max_elementname[1];
+                    dr["ColVal2"] = list_max_elementvale[1].ToString();
+                    //元素3
+                    dr["ColName3"] = list_max_elementname[2];
+                    dr["ColVal3"] = list_max_elementvale[2].ToString();
+                    //元素4
+                    dr["ColName4"] = list_max_elementname[3];
+                    dr["ColVal4"] = list_max_elementvale[3].ToString();
+                    //元素5
+                    dr["ColName5"] = list_max_elementname[4];
+                    dr["ColVal5"] = list_max_elementvale[4].ToString();
+                    //元素6
+                    dr["ColName6"] = list_max_elementname[5];
+                    dr["ColVal6"] = list_max_elementvale[5].ToString();
+                    //元素6
+                    dr["ColName7"] = list_max_elementname[6];
+                    dr["ColVal7"] = list_max_elementvale[6].ToString();
+                    //元素6
+                    dr["ColName8"] = list_max_elementname[7];
+                    dr["ColVal8"] = list_max_elementvale[7].ToString();
+                    //元素6
+                    dr["ColName9"] = list_max_elementname[8];
+                    dr["ColVal9"] = list_max_elementvale[8].ToString();
+                    //元素6
+                    dr["ColName10"] = list_max_elementname[9];
+                    dr["ColVal10"] = list_max_elementvale[9].ToString();
+
+                    FrameGraphSubTable.Rows.Add(dr);
+                }
+
+            }
+            data_A = FrameGraphSubTable.Copy();
+
+        }
+
+        public void ParticleSizeTable(MBSZClass m_mbszclass, out DataTable surface_dt, out DataTable partsize_dt, out DataTable class_dt, out DataTable subdivide_dt)
+        {
+            //全部大类
+            DataTable dt_addCalss = new DataTable();
+            DataTable dt_allSubdivision = new DataTable();
+            //全部小类
+
+            if (m_bt_DBData.Columns.Count == 0)
+            {
+                GetDBData(m_mbszclass);
+            }
+
+            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;
+            DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXml(path1);
+            string sizestr = ds.Tables[0].Rows[0]["Sizes"].ToString();
+
+            for (int i = 0; i < sizestr.Split(',').Length - 1; i++)
+            {
+                if (sizestr.Split(',')[i].Length > 0)
+                {
+                    double d1 = Convert.ToDouble(sizestr.Split(',')[i]);
+                    double d2 = Convert.ToDouble(sizestr.Split(',')[i + 1]);
+                    colid.Add(d1.ToString() + "~" + d2.ToString());
+                }
+            }
+            double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
+            colid.Add(d.ToString() + "~MAX");
+            ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
+
+            //------------------------------------------------
+            DataTable ls_partsize_dt = new DataTable();
+            ls_partsize_dt.TableName = "PartSize";
+            ls_partsize_dt.Columns.Add("c1");
+            ls_partsize_dt.Columns.Add("c2");
+            ls_partsize_dt.Columns.Add("c3");
+            ls_partsize_dt.Columns.Add("c4");
+            ls_partsize_dt.Columns.Add("c5");
+            ls_partsize_dt.Columns.Add("c6");
+            ls_partsize_dt.Columns.Add("c7");
+            ls_partsize_dt.Columns.Add("c8");
+            ls_partsize_dt.Columns.Add("c9");
+
+            DataRow dr = ls_partsize_dt.NewRow();
+            for (int i = 1; i < 10; i++)
+            {
+                if (colid.Count < i)
+                {
+                    dr["c" + i.ToString()] = "";
+                }
+                else
+                {
+                    dr["c" + i.ToString()] = colid[i - 1];
+                }
+            }
+            ls_partsize_dt.Rows.Add(dr);
+
+
+            DataTable ls_Particel_dt = new DataTable();
+            ls_Particel_dt.TableName = "Particel";
+
+            ls_Particel_dt.Columns.Add("c1", typeof(double));
+            ls_Particel_dt.Columns.Add("c2", typeof(double));
+            ls_Particel_dt.Columns.Add("c3", typeof(double));
+            ls_Particel_dt.Columns.Add("c4", typeof(double));
+            ls_Particel_dt.Columns.Add("c5", typeof(double));
+            ls_Particel_dt.Columns.Add("c6", typeof(double));
+            ls_Particel_dt.Columns.Add("c7", typeof(double));
+            ls_Particel_dt.Columns.Add("c8", typeof(double));
+            ls_Particel_dt.Columns.Add("c9", typeof(double));
+            ls_Particel_dt.Columns.Add("Name");
+            ls_Particel_dt.Columns.Add("total", typeof(double));
+            ls_Particel_dt.Columns.Add("TypeId");
+            ls_Particel_dt.Columns.Add("Class");
+
+            for (int i = 0; i < m_bt_DBData.Rows.Count; i++)
+            {
+                DataRow dr2 = ls_Particel_dt.NewRow();
+                dr2["Name"] = m_bt_DBData.Rows[i]["TypeName"].ToString();
+                dr2["Class"] = m_bt_DBData.Rows[i]["Class"].ToString();
+                dr2["TypeId"] = m_bt_DBData.Rows[i]["TypeId"].ToString();//获取分类编号
+                for (int j = 1; j < 10; j++)
+                {
+                    if (colid.Count >= j)
+                    {
+                        dr2["c" + j.ToString()] = Convert.ToDouble(m_bt_DBData.Rows[i][colid[j - 1]]);
+                    }
+                }
+                if (dr2["Name"].ToString() != "" && dr2["Name"].ToString().IndexOf("number") < 0)
+                {
+                    dr2["total"] = "0"; //求合
+                    double d_total = 0;
+
+                    for (int j = 1; j < 10; j++)
+                    {
+                        if (colid.Count >= j)
+                        {
+                            d_total = d_total + Convert.ToInt64(m_bt_DBData.Rows[i][colid[j - 1]]);
+                        }
+                    }
+                    dr2["total"] = d_total.ToString();
+                }
+                ls_Particel_dt.Rows.Add(dr2);
+            }
+            dt_allSubdivision = ls_Particel_dt.Copy();
+            //按照list列表进行物质类排序,物质类中的元素分类按照面积的大小进行排序
+            List<string> ClassName = new List<string>();
+            DataTable getClass_dt = fielddata.GetAllClass();
+            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")
+                    ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
+            }
+
+            //获取大分类信息
+            DataTable dt = InvalidRemoval(QuantityOfIntegratedSubstances(ls_Particel_dt, ClassName), "Class");
+            dt_addCalss = dt.Copy();
+            DataTable data = classIfIcationSort(ls_Particel_dt, ClassName, dt);
+
+            surface_dt = data.Copy();
+            class_dt = dt_addCalss.Copy();
+            subdivide_dt = dt_allSubdivision.Copy();
+            partsize_dt = ls_partsize_dt.Copy();
+        }
+
+        private DataTable classIfIcationSort(DataTable dataTable, List<string> ClassName, DataTable data)
+        {
+            DataTable dt = new DataTable();
+            dt = dataTable.Copy();
+            dt.Clear();
+            dt.TableName = "Particel_subdivision";
+            //循环list中每个类型
+            for (int i = 0; i < ClassName.Count(); i++)
+            {
+                DataTable data1 = dt.Copy();
+                data1.Clear();
+                data1.Rows.Add();
+                for (int a = 0; a < data.Rows.Count; a++)
+                {
+                    if (data.Rows[a]["Class"].ToString() == ClassName[i].ToString())
+                    {
+                        for (int b = 1; b < 10; b++)
+                        {
+                            data1.Rows[0]["c" + b.ToString()] = data.Rows[a]["c" + b.ToString()];
+                        }
+                        data1.Rows[0]["total"] = data.Rows[a]["total"];
+                        data1.Rows[0]["Class"] = data.Rows[a]["Class"];
+
+                        dt.Rows.Add(data1.Rows[0].ItemArray);
+                    }
+                }
+
+                DataTable dt_1 = new DataTable();
+                dt_1 = dt.Copy();
+                dt_1.Clear();
+                //循环DataTable中每个分类的数据
+                for (int a = 0; a < dataTable.Rows.Count; a++)
+                {
+                    if (dataTable.Rows[a]["Class"].ToString() == ClassName[i])
+                    {
+                        dataTable.Rows[a]["Class"] = "";
+                        dt_1.Rows.Add(dataTable.Rows[a].ItemArray);
+                    }
+                }
+                //将颗粒数量排序(从大到小)
+                DataView dv = dt_1.DefaultView;
+                dv.Sort = "total DESC";
+                DataTable dt_1_sort = dv.ToTable();
+                for (int a = 0; a < dt_1_sort.Rows.Count; a++)
+                {
+                    dt.Rows.Add(dt_1_sort.Rows[a].ItemArray);
+                }
+            }
+            dt.Columns.Remove("TypeId");
+
+            return dt;
+
+        }
+
+        public bool InsertReportTemplateTable_ElementAvgGrid(MBSZClass m_mbszclass, out DataTable dt1, out DataTable dt2)
+        {
+            if (m_bt_DBData.Columns.Count == 0)
+            {
+                GetDBData(m_mbszclass);
+            }
+
+            //根据sql条件,查询获取颗粒信息数据
+            ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
+
+            DataTable AllAnalysisDetails = new DataTable();
+            AllAnalysisDetails.TableName = "ElementValue";
+            AllAnalysisDetails.Columns.Add("Name");
+            AllAnalysisDetails.Columns.Add("TypeId");
+            AllAnalysisDetails.Columns.Add("Area", typeof(double));
+            AllAnalysisDetails.Columns.Add("Class");
+            for (int i = 0; i < m_bt_DBData.Rows.Count; i++)
+            {
+                DataRow dr2 = AllAnalysisDetails.NewRow();
+                dr2["Name"] = m_bt_DBData.Rows[i]["TypeName"].ToString();
+                dr2["Area"] = Convert.ToDouble(m_bt_DBData.Rows[i]["ar"]);
+                dr2["TypeId"] = m_bt_DBData.Rows[i]["TypeId"].ToString();
+                dr2["Class"] = m_bt_DBData.Rows[i]["Class"].ToString();
+                AllAnalysisDetails.Rows.Add(dr2);
+            }
+
+            //按照list列表进行物质类排序,物质类中的元素分类按照面积的大小进行排序
+            List<string> ClassName = new List<string>();
+            DataTable getClass_dt = fielddata.GetAllClass();
+            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")
+                    ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
+            }
+
+            //统计元素物质大类的元素信息和面积占比
+            DataTable dt_ElementalSubstance = ElementalSubstance(AllAnalysisDetails, ClassName, fielddata);
+            //统计元素并按照Class Name自定义列表进行排序,大类中的小类元素信息按照面积从大到小排序
+            DataTable dt_ElementSorting = ElementSorting(AllAnalysisDetails, ClassName, fielddata);
+            //生成最后导出时物质元素成分表
+            DataTable dt = MaterialElementComposition(dt_ElementalSubstance, 13);//导出14个元素成分信息
+            //生成最后导出时物质元素细分表
+            SubdivisionOfMaterialElements(dt_ElementSorting, 13, ClassName, dt, out dt1, out dt2);
+
+
+            return true;
+
+        }
+
+        private bool SubdivisionOfMaterialElements(DataTable a_ElementalSubstance, int NumberOfColumns, List<string> ClassName, DataTable data, out DataTable dt1, out DataTable dt2)
+        {
+
+            DataTable dt_ElementalSubstance = new DataTable();
+            dt_ElementalSubstance = data.Copy();
+            dt_ElementalSubstance.Clear();
+            dt_ElementalSubstance.TableName = "ElementSubdivision_Value";
+            dt_ElementalSubstance.Columns["Name"].ColumnName = "Class";
+            dt_ElementalSubstance.Columns.Add("Name");
+            //处理元素面积保留小数点后两位
+            for (int i = 0; i < a_ElementalSubstance.Rows.Count; i++)
+            {
+                a_ElementalSubstance.Rows[i]["Area"] = Math.Round(Convert.ToDouble(a_ElementalSubstance.Rows[i]["Area"].ToString()), 2);
+            }
+
+
+            //循环元素物质大类
+            for (int i = 0; i < ClassName.Count; i++)
+            {
+                DataTable dt_1 = new DataTable();
+                dt_1 = data.Copy();
+                dt_1.Clear();
+                for (int a = 0; a < data.Rows.Count; a++)
+                {
+                    if (data.Rows[a]["Name"].ToString() == ClassName[i].ToString())
+                    {
+                        dt_1.Rows.Add(data.Rows[a].ItemArray);
+                    }
+                }
+                dt_1.Columns["Name"].ColumnName = "Class";
+                dt_1.Columns.Add("Name");
+
+                DataTable dt_2 = new DataTable();
+                dt_2 = dt_1.Copy();
+                dt_2.Clear();
+                dt_2.Rows.Add();
+                //循环整个表筛选出当前的物质
+                for (int a = 0; a < a_ElementalSubstance.Rows.Count; a++)
+                {
+                    if (ClassName[i].ToString() == a_ElementalSubstance.Rows[a]["Class"].ToString())
+                    {
+                        for (int b = 0; b < dt_1.Columns.Count; b++)
+                        {
+                            if (dt_2.Columns[b].ToString() != "Class")
+                            {
+                                if (a_ElementalSubstance.Columns.Contains(dt_2.Columns[b].ToString()))
+                                {
+                                    if (a_ElementalSubstance.Rows[a][dt_2.Columns[b].ToString()].ToString() == "")
+                                    {
+                                        dt_2.Rows[0][dt_2.Columns[b].ToString()] = 0;
+                                    }
+                                    else
+                                    {
+                                        dt_2.Rows[0][dt_2.Columns[b].ToString()] = a_ElementalSubstance.Rows[a][dt_2.Columns[b].ToString()];
+                                    }
+                                }
+                                else
+                                {
+                                    dt_2.Rows[0][dt_2.Columns[b].ToString()] = 0;
+                                }
+
+                            }
+                        }
+                        dt_1.Rows.Add(dt_2.Rows[0].ItemArray);
+                    }
+                }
+
+                for (int a = 0; a < dt_1.Rows.Count; a++)
+                {
+                    dt_ElementalSubstance.Rows.Add(dt_1.Rows[a].ItemArray);
+                }
+            }
+
+
+
+            DataTable dataTable = new DataTable();
+            dataTable = dt_ElementalSubstance.Copy();
+            dataTable.Clear();
+            DataRow row = dataTable.NewRow();
+            dataTable.Rows.Add(row);
+            dataTable.TableName = "ElementSubdivision_Name";
+            for (int i = 0; i < dataTable.Columns.Count; i++)
+            {
+                dataTable.Rows[0][dataTable.Columns[i].ToString()] = dataTable.Columns[i].ToString();
+            }
+            dt1 = dataTable.Copy();
+            dt2 = dt_ElementalSubstance.Copy();
+            //m_list_dt.Add(dataTable);
+            //m_list_dt.Add(dt_ElementalSubstance);
+            return true;
+        }
+
+        public Bitmap GetByte_InsertReportChart_Trianglediagram(int selectindex, MBSZClass m_mbszclass)
+        {
+            //加载模块
+            EChart_Trianglediagram eChart_Trianglediagram = new EChart_Trianglediagram(m_otsreport_export.m_ReportApp, TemplateList[selectindex]);
+            m_otsreport_export.m_ReportApp.timerKG = true;
+            eChart_Trianglediagram.condition = m_otsreport_export.m_mbszclass.M_SYXT.index_cb_syxt_jsfs;
+            if (m_mbszclass.M_SY.int_xzkl == 0)
+            {
+                eChart_Trianglediagram.ParticleRange = true;
+            }
+            else
+            {
+                eChart_Trianglediagram.ParticleRange = false;
+            }
+            eChart_Trianglediagram.Report = true;
+            m_otsreport_export.m_ReportApp.m_ChartsWindow.Controls.Add(eChart_Trianglediagram);
+            //弹出加载图片窗体
+            OTSReport_GetEChartImage og = new OTSReport_GetEChartImage();
+            //将EChart委托事件注册给加载图片窗体的方法
+            eChart_Trianglediagram.butclic += og.get_ParticalesCompositionChart;
+            og.ShowDialog();
+            //获取图片数据
+            string str = og.PicStr;
+            //将Base64String转为图片并保存
+            byte[] arr = Convert.FromBase64String(str.Substring(str.IndexOf(',') + 1));
+            Bitmap btmap_pic = new Bitmap(new MemoryStream(arr));
 
+            return btmap_pic;
+        }
+        /// <summary>
+        /// 大分类数据
+        /// </summary>
+        /// <param name="m_mbszclass"></param>
+        /// <returns></returns>
+        public DataTable ClassificationIntegration(MBSZClass m_mbszclass,string str)
+        {
+            ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
+            DataTable data = new DataTable();
+            if (m_mbszclass.M_SY.int_xzkl == 0)
+            {
+                data = fielddata.GetAreaByAllIncA("");//获取所有分类面积和数量信息
+            }
+            else
+            {
+                DataTable AllInca = fielddata.GetAreaByAllIncA("");
+                DataTable SelectParticl = SelectParticleData();
+                data = GetParticleListForParticlSize(SelectParticl, AllInca);
+            }
 
-       
+
+            DataTable AreaInformationOfAllElements = ConSolidateInvalid(data);
+            DataTable AllAnalysisDetails = new DataTable();
+            AllAnalysisDetails.Columns.Add("Name");
+            AllAnalysisDetails.Columns.Add("TypeId");
+            AllAnalysisDetails.Columns.Add("Area", typeof(double));
+            AllAnalysisDetails.Columns.Add("Class");
+            AllAnalysisDetails.Columns.Add("Cunt", typeof(double));
+            for (int i = 0; i < AreaInformationOfAllElements.Rows.Count; i++)
+            {
+                DataRow dr2 = AllAnalysisDetails.NewRow();
+                dr2["Name"] = AreaInformationOfAllElements.Rows[i]["TypeName"].ToString();
+                dr2["Area"] = Convert.ToDouble(AreaInformationOfAllElements.Rows[i]["ar"]);
+                dr2["TypeId"] = AreaInformationOfAllElements.Rows[i]["TypeId"].ToString();
+                dr2["Cunt"] = Convert.ToDouble(AreaInformationOfAllElements.Rows[i]["con"]);
+                dr2["Class"] = AreaInformationOfAllElements.Rows[i]["GroupName"].ToString();
+                AllAnalysisDetails.Rows.Add(dr2);
+            }
+            //按照list列表进行物质类排序,物质类中的元素分类按照面积的大小进行排序
+            List<string> ClassName = new List<string>();
+            DataTable getClass_dt = fielddata.GetAllClass();
+            for (int i = 0; i < getClass_dt.Rows.Count; i++)
+            {
+                ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
+            }
+
+            DataTable AreaRatio = new DataTable();
+            AreaRatio.TableName = "InclusionAreaRatio";
+            AreaRatio.Columns.Add("Class");
+            AreaRatio.Columns.Add("Name");
+            AreaRatio.Columns.Add("Area", typeof(double));
+            AreaRatio.Columns.Add("inca_proportion");
+            AreaRatio.Columns.Add("inca_FieldRatio");
+            AreaRatio.Columns.Add("Cunt", typeof(int));
+
+            //获取夹杂物的总面积用于计算夹杂物类别的占比(gridview最后一个固定是未识别颗粒,要排除未识别颗粒所以for循环至grid view长度减一)
+            double totalInclusionArea = Convert.ToDouble(decimal.Parse(AllAnalysisDetails.Compute("sum(Area)", "").ToString()));
+            for (int i = 0; i < AllAnalysisDetails.Rows.Count; i++)
+            {
+                DataRow dr2 = AreaRatio.NewRow();
+                dr2["Class"] = AllAnalysisDetails.Rows[i]["Class"].ToString();
+                dr2["Name"] = AllAnalysisDetails.Rows[i]["Name"].ToString();
+                dr2["Area"] = Convert.ToDouble(AllAnalysisDetails.Rows[i]["Area"]);
+                dr2["inca_proportion"] = Math.Round((Convert.ToDouble(AllAnalysisDetails.Rows[i]["Area"]) / totalInclusionArea) * 100, 2);
+                dr2["inca_FieldRatio"] = Math.Round((Convert.ToDouble(AllAnalysisDetails.Rows[i]["Area"]) / Convert.ToDouble(str)) * 100, 4);
+                dr2["Cunt"] = AllAnalysisDetails.Rows[i]["Cunt"].ToString();
+                AreaRatio.Rows.Add(dr2);
+            }
+
+
+            DataTable AreaRatio_dt = AreaRatio.Copy();
+            AreaRatio_dt.Clear();
+
+            for (int i = 0; i < ClassName.Count(); i++)
+            {
+                DataTable dt = AreaRatio.Copy();
+                dt.Clear();
+                for (int a = 0; a < AreaRatio.Rows.Count; a++)
+                {
+                    if (AreaRatio.Rows[a]["Class"].ToString() == ClassName[i].ToString())
+                    {
+                        dt.Rows.Add(AreaRatio.Rows[a].ItemArray);
+                    }
+                }
+
+                DataView dv = dt.DefaultView;
+                dv.Sort = "Area DESC";
+                DataTable dt_Element = dv.ToTable();
+                for (int a = 0; a < dt_Element.Rows.Count; a++)
+                {
+                    AreaRatio_dt.Rows.Add(dt_Element.Rows[a].ItemArray);
+                }
+            }
+
+
+            DataTable AllAnalysisDetails1 = AreaRatio_dt.Copy();
+            AllAnalysisDetails1.Clear();
+
+            for (int i = 0; i < ClassName.Count; i++)
+            {
+                DataTable dt = AreaRatio_dt.Copy();
+                dt.Clear();
+                for (int a = 0; a < AreaRatio_dt.Rows.Count; a++)
+                {
+                    if (AreaRatio_dt.Rows[a]["Class"].ToString() == ClassName[i].ToString())
+                    {
+                        dt.Rows.Add(AreaRatio_dt.Rows[a].ItemArray);
+                    }
+                }
+                if (dt.Rows.Count > 0)
+                {
+                    double totalInclusionArea2 = Convert.ToDouble(decimal.Parse(AreaRatio_dt.Compute("sum(Area)", "").ToString()));
+                    double Area = Convert.ToDouble(decimal.Parse(dt.Compute("sum(Area)", "").ToString()));
+                    int cunt = Convert.ToInt32(decimal.Parse(dt.Compute("sum(Cunt)", "").ToString()));
+                    DataRow dr3 = AllAnalysisDetails1.NewRow();
+                    dr3["Class"] = ClassName[i].ToString();
+                    dr3["Area"] = Math.Round(Area, 2);
+                    dr3["inca_proportion"] = Math.Round((Convert.ToDouble(dt.Rows[0]["Area"]) / totalInclusionArea2) * 100, 2);
+                    dr3["inca_FieldRatio"] = Math.Round((Convert.ToDouble(dt.Rows[0]["Area"]) / Convert.ToDouble(str)) * 100, 4);
+                    dr3["Cunt"] = cunt;
+                    AllAnalysisDetails1.Rows.Add(dr3);
+                }
+            }
+            return AllAnalysisDetails1;
+        }
+
+        private DataTable SelectParticleData()
+        {
+            List<Particle> selectParticles = m_otsreport_export.m_ReportApp.GetSelectedParticles();
+
+            #region Datatable数据表格式
+            DataTable dtUelect = new DataTable();
+            dtUelect.Columns.Add("fieldid");
+            dtUelect.Columns.Add("particleid");
+            dtUelect.Columns.Add("AveGray");
+            dtUelect.Columns.Add("RectLeft");
+            dtUelect.Columns.Add("RectTop");
+            dtUelect.Columns.Add("RectWidth");
+            dtUelect.Columns.Add("RectHeight");
+            dtUelect.Columns.Add("Area");
+            dtUelect.Columns.Add("PosX");
+            dtUelect.Columns.Add("PosY");
+            dtUelect.Columns.Add("TypeId");
+            dtUelect.Columns.Add("SegmentNum");
+            dtUelect.Columns.Add("SEMPosX");
+            dtUelect.Columns.Add("SEMPosY");
+            dtUelect.Columns.Add("XrayId");
+            dtUelect.Columns.Add("DMAX");
+            dtUelect.Columns.Add("DMIN");
+            dtUelect.Columns.Add("DPERP");
+            dtUelect.Columns.Add("PERIMETER");
+            dtUelect.Columns.Add("ORIENTATION");
+            dtUelect.Columns.Add("DINSCR");
+            dtUelect.Columns.Add("DMEAN");
+            dtUelect.Columns.Add("DELONG");
+            dtUelect.Columns.Add("DFERET");
+            dtUelect.Columns.Add("TypeName");
+            dtUelect.Columns.Add("TypeColor");
+
+            #endregion
+            for (int i = 0; i < selectParticles.Count; i++)
+            {
+                dtUelect.Rows.Add(selectParticles[i].FieldId, selectParticles[i].ParticleId, selectParticles[i].AveGray, selectParticles[i].RectLeft, selectParticles[i].RectTop, selectParticles[i].RectWidth, selectParticles[i].RectHeight, selectParticles[i].Area, selectParticles[i].PosX, selectParticles[i].PosX, selectParticles[i].TypeId, /*selectParticles[i].ElementNum,*/ selectParticles[i].SegmentNum, selectParticles[i].SEMPosX, selectParticles[i].SEMPosY, selectParticles[i].ParticleId, selectParticles[i].DMAX, selectParticles[i].DMIN, selectParticles[i].DPERP, selectParticles[i].PERIMETER, selectParticles[i].ORIENTATION, selectParticles[i].DINSCR, selectParticles[i].DMEAN, selectParticles[i].DELONG, selectParticles[i].DFERET, selectParticles[i].TypeName, selectParticles[i].TypeColor);
+            }
+            return dtUelect;
+        }
+
+        private DataTable ConSolidateInvalid(DataTable dt)
+        {
+
+            DataTable dt_invalid = dt.Clone();
+            DataTable dt_no_invalid = dt.Clone();
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                if (dt.Rows[i]["TypeName"].ToString() == "Invalid")
+                {
+                    dt_invalid.Rows.Add(dt.Rows[i].ItemArray);
+                }
+                else
+                {
+                    dt_no_invalid.Rows.Add(dt.Rows[i].ItemArray);
+                }
+            }
+            return dt_no_invalid;
+        }
+
+        /// <summary>
+        /// 细分类数据
+        /// </summary>
+        /// <param name="m_mbszclass"></param>
+        /// <returns></returns>
+        public DataTable subdivisionIntegration(MBSZClass m_mbszclass)
+        {
+            ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
+
+            DataTable data = new DataTable();
+            if (m_mbszclass.M_SY.int_xzkl == 0)
+            {
+                data = fielddata.GetAreaByAllIncA("");//获取所有分类面积和数量信息
+            }
+            else
+            {
+                DataTable AllInca = fielddata.GetAreaByAllIncA("");
+                DataTable SelectParticl = SelectParticleData();
+                data = GetParticleListForParticlSize(SelectParticl, AllInca);
+            }
+            return ConSolidateInvalid(data);
+        }
+        public void GenerateINCAtable(string str,out DataTable dt)
+        {
+            //根据sql条件,查询获取颗粒信息数据
+            ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
+
+            //按照list列表进行物质类排序,物质类中的元素分类按照面积的大小进行排序
+            List<string> ClassName = new List<string>();
+            DataTable getClass_dt = fielddata.GetAllClass();
+            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")
+                    ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
+            }
+            //夹杂物面积比添加大类
+            DataTable RawParticleData = InclusionAreaRatio_2(str);
+            //夹杂物面积比计算大类占比
+            ProportionOfParticleArea(RawParticleData, ClassName, str, out dt);
+        }
+        private bool ProportionOfParticleArea(DataTable dataTable, List<string> ClassName,string str, out DataTable dt_out)
+        {
+            DataTable AllAnalysisDetails = dataTable.Copy();
+            AllAnalysisDetails.Clear();
+            AllAnalysisDetails.TableName = "InclusionAreaRatio";
+
+            for (int i = 0; i < ClassName.Count; i++)
+            {
+                DataTable dt = dataTable.Copy();
+                dt.Clear();
+                for (int a = 0; a < dataTable.Rows.Count; a++)
+                {
+                    if (dataTable.Rows[a]["Class"].ToString() == ClassName[i].ToString())
+                    {
+                        dt.Rows.Add(dataTable.Rows[a].ItemArray);
+                    }
+                }
+                if (dt.Rows.Count > 0)
+                {
+                    double totalInclusionArea = Convert.ToDouble(decimal.Parse(dataTable.Compute("sum(Area)", "").ToString()));
+                    double Area = Convert.ToDouble(decimal.Parse(dt.Compute("sum(Area)", "").ToString()));
+                    DataRow dr = AllAnalysisDetails.NewRow();
+                    dr["Class"] = ClassName[i].ToString();
+                    dr["Area"] = Math.Round(Area, 2);
+                    //Convert.ToDouble(decimal.Parse(dt.Compute("sum(e3)", "").ToString()));
+                    dr["inca_proportion"] = Math.Round((Convert.ToDouble(Area) / totalInclusionArea) * 100, 2);
+                    dr["inca_FieldRatio"] = Math.Round((Convert.ToDouble(Area) / Convert.ToDouble(str)) * 100, 4);
+                    AllAnalysisDetails.Rows.Add(dr);
+
+                    DataView dv = dt.DefaultView;
+                    dv.Sort = "Area DESC";
+                    DataTable dt_Area = dv.ToTable();
+                    for (int a = 0; a < dt_Area.Rows.Count; a++)
+                    {
+                        dt_Area.Rows[a]["Class"] = "";
+                        dt_Area.Rows[a]["Area"] = Math.Round(Convert.ToDouble(dt_Area.Rows[a]["Area"]), 2);
+                        AllAnalysisDetails.Rows.Add(dt_Area.Rows[a].ItemArray);
+                    }
+                }
+            }
+            dt_out = AllAnalysisDetails.Copy();
+            return true;
+        }
+
+
+
+        private DataTable InclusionAreaRatio_2(string str)
+        {
+
+            //根据sql条件,查询获取颗粒信息数据
+            ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
+
+            DataTable AreaInformationOfAllElements = InvalidRemoval(InvalidRemoval(fielddata.GetAreaByAllIncA(""), "GroupName"), "TypeName");
+            DataTable AllAnalysisDetails = new DataTable();
+
+            AllAnalysisDetails.Columns.Add("Name");
+            AllAnalysisDetails.Columns.Add("TypeId");
+            AllAnalysisDetails.Columns.Add("Area", typeof(double));
+            AllAnalysisDetails.Columns.Add("Class");
+            AllAnalysisDetails.Columns.Add("Cunt", typeof(double));
+            for (int i = 0; i < AreaInformationOfAllElements.Rows.Count; i++)
+            {
+
+                DataRow dr2 = AllAnalysisDetails.NewRow();
+                dr2["Name"] = AreaInformationOfAllElements.Rows[i]["TypeName"].ToString();
+                dr2["Area"] = Convert.ToDouble(AreaInformationOfAllElements.Rows[i]["ar"]);
+                dr2["TypeId"] = AreaInformationOfAllElements.Rows[i]["TypeId"].ToString();
+                dr2["Cunt"] = Convert.ToDouble(AreaInformationOfAllElements.Rows[i]["con"]);
+                dr2["Class"] = AreaInformationOfAllElements.Rows[i]["GroupName"].ToString();
+                AllAnalysisDetails.Rows.Add(dr2);
+            }
+
+            List<string> ClassName = new List<string>();
+            DataTable getClass_dt = fielddata.GetAllClass();
+            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")
+                    ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
+            }
+
+            DataTable AreaRatio = new DataTable();
+            AreaRatio.TableName = "InclusionAreaRatio";
+            AreaRatio.Columns.Add("Class");
+            AreaRatio.Columns.Add("subdivision");
+            AreaRatio.Columns.Add("Area", typeof(double));
+            AreaRatio.Columns.Add("inca_proportion");
+            AreaRatio.Columns.Add("inca_FieldRatio");
+            //获取夹杂物的总面积用于计算夹杂物类别的占比(gridview最后一个固定是未识别颗粒,要排除未识别颗粒所以for循环至grid view长度减一)
+            int sumArea = 0;
+            for (int i = 0; i < AllAnalysisDetails.Rows.Count; i++)
+            {
+                sumArea = sumArea + Convert.ToInt32(AllAnalysisDetails.Rows[i]["Area"]);
+            }
+
+            for (int i = 0; i < AllAnalysisDetails.Rows.Count; i++)
+            {
+                DataRow dr = AreaRatio.NewRow();
+                dr["Class"] = AllAnalysisDetails.Rows[i]["Class"].ToString();
+                dr["subdivision"] = AllAnalysisDetails.Rows[i]["Name"].ToString();
+                dr["Area"] = Convert.ToDouble(AllAnalysisDetails.Rows[i]["Area"]);
+                dr["inca_proportion"] = Math.Round((Convert.ToDouble(AllAnalysisDetails.Rows[i]["Area"]) / sumArea) * 100, 2);
+                dr["inca_FieldRatio"] = Math.Round((Convert.ToDouble(AllAnalysisDetails.Rows[i]["Area"]) / Convert.ToDouble(str)) * 100, 4);
+                AreaRatio.Rows.Add(dr);
+            }
+
+
+            DataTable AreaRatio_dt = AreaRatio.Copy();
+            AreaRatio_dt.Clear();
+
+            for (int i = 0; i < ClassName.Count(); i++)
+            {
+
+                DataTable dt = AreaRatio.Copy();
+                dt.Clear();
+                for (int a = 0; a < AreaRatio.Rows.Count; a++)
+                {
+                    if (AreaRatio.Rows[a]["Class"].ToString() == ClassName[i].ToString())
+                    {
+                        dt.Rows.Add(AreaRatio.Rows[a].ItemArray);
+                    }
+                }
+
+                DataView dv = dt.DefaultView;
+                dv.Sort = "Area DESC";
+                DataTable dt_Element = dv.ToTable();
+                for (int a = 0; a < dt_Element.Rows.Count; a++)
+                {
+                    AreaRatio_dt.Rows.Add(dt_Element.Rows[a].ItemArray);
+                }
+            }
+            return AreaRatio_dt;
+        }
     }
 
 }

+ 68 - 39
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_Export.Designer.cs

@@ -47,46 +47,52 @@
             this.btn_preview = new System.Windows.Forms.Button();
             this.backgroundWorker2 = new System.ComponentModel.BackgroundWorker();
             this.button7 = new System.Windows.Forms.Button();
+            this.button1 = new System.Windows.Forms.Button();
             this.SuspendLayout();
             // 
             // richTextBox1
             // 
-            this.richTextBox1.Location = new System.Drawing.Point(20, 80);
+            this.richTextBox1.Location = new System.Drawing.Point(13, 53);
+            this.richTextBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.richTextBox1.Name = "richTextBox1";
-            this.richTextBox1.Size = new System.Drawing.Size(680, 344);
+            this.richTextBox1.Size = new System.Drawing.Size(455, 231);
             this.richTextBox1.TabIndex = 60;
             this.richTextBox1.Text = "";
             // 
             // progressBar1
             // 
-            this.progressBar1.Location = new System.Drawing.Point(140, 440);
+            this.progressBar1.Location = new System.Drawing.Point(93, 293);
+            this.progressBar1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.progressBar1.Name = "progressBar1";
-            this.progressBar1.Size = new System.Drawing.Size(561, 22);
+            this.progressBar1.Size = new System.Drawing.Size(374, 15);
             this.progressBar1.TabIndex = 70;
             // 
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(8, 440);
+            this.label2.Location = new System.Drawing.Point(5, 293);
+            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(116, 18);
+            this.label2.Size = new System.Drawing.Size(77, 12);
             this.label2.TabIndex = 1004;
             this.label2.Text = "当前导出进度";
             // 
             // label3
             // 
             this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(16, 14);
+            this.label3.Location = new System.Drawing.Point(11, 9);
+            this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(80, 18);
+            this.label3.Size = new System.Drawing.Size(53, 12);
             this.label3.TabIndex = 1001;
             this.label3.Text = "选择模板";
             // 
             // btn_exit
             // 
-            this.btn_exit.Location = new System.Drawing.Point(584, 478);
+            this.btn_exit.Location = new System.Drawing.Point(389, 319);
+            this.btn_exit.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.btn_exit.Name = "btn_exit";
-            this.btn_exit.Size = new System.Drawing.Size(110, 40);
+            this.btn_exit.Size = new System.Drawing.Size(73, 27);
             this.btn_exit.TabIndex = 90;
             this.btn_exit.Text = "退  出";
             this.btn_exit.UseVisualStyleBackColor = true;
@@ -95,27 +101,30 @@
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(16, 50);
+            this.label1.Location = new System.Drawing.Point(11, 33);
+            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(80, 18);
+            this.label1.Size = new System.Drawing.Size(53, 12);
             this.label1.TabIndex = 1002;
             this.label1.Text = "保存路径";
             this.label1.Visible = false;
             // 
             // tb_lj
             // 
-            this.tb_lj.Location = new System.Drawing.Point(102, 45);
+            this.tb_lj.Location = new System.Drawing.Point(68, 30);
+            this.tb_lj.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.tb_lj.Name = "tb_lj";
             this.tb_lj.ReadOnly = true;
-            this.tb_lj.Size = new System.Drawing.Size(426, 28);
+            this.tb_lj.Size = new System.Drawing.Size(285, 21);
             this.tb_lj.TabIndex = 30;
             this.tb_lj.Visible = false;
             // 
             // btn_selectPath
             // 
-            this.btn_selectPath.Location = new System.Drawing.Point(534, 44);
+            this.btn_selectPath.Location = new System.Drawing.Point(356, 29);
+            this.btn_selectPath.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.btn_selectPath.Name = "btn_selectPath";
-            this.btn_selectPath.Size = new System.Drawing.Size(70, 30);
+            this.btn_selectPath.Size = new System.Drawing.Size(47, 20);
             this.btn_selectPath.TabIndex = 40;
             this.btn_selectPath.Text = "...";
             this.btn_selectPath.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -125,17 +134,19 @@
             // 
             // tb_mblj
             // 
-            this.tb_mblj.Location = new System.Drawing.Point(102, 9);
+            this.tb_mblj.Location = new System.Drawing.Point(68, 6);
+            this.tb_mblj.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.tb_mblj.Name = "tb_mblj";
             this.tb_mblj.ReadOnly = true;
-            this.tb_mblj.Size = new System.Drawing.Size(426, 28);
+            this.tb_mblj.Size = new System.Drawing.Size(285, 21);
             this.tb_mblj.TabIndex = 0;
             // 
             // btn_openfilepath
             // 
-            this.btn_openfilepath.Location = new System.Drawing.Point(534, 6);
+            this.btn_openfilepath.Location = new System.Drawing.Point(356, 4);
+            this.btn_openfilepath.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.btn_openfilepath.Name = "btn_openfilepath";
-            this.btn_openfilepath.Size = new System.Drawing.Size(70, 30);
+            this.btn_openfilepath.Size = new System.Drawing.Size(47, 20);
             this.btn_openfilepath.TabIndex = 10;
             this.btn_openfilepath.Text = "...";
             this.btn_openfilepath.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -144,9 +155,10 @@
             // 
             // btn_TempDes
             // 
-            this.btn_TempDes.Location = new System.Drawing.Point(610, 6);
+            this.btn_TempDes.Location = new System.Drawing.Point(407, 4);
+            this.btn_TempDes.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.btn_TempDes.Name = "btn_TempDes";
-            this.btn_TempDes.Size = new System.Drawing.Size(98, 30);
+            this.btn_TempDes.Size = new System.Drawing.Size(65, 20);
             this.btn_TempDes.TabIndex = 20;
             this.btn_TempDes.Text = "导出编辑";
             this.btn_TempDes.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -156,9 +168,10 @@
             // label4
             // 
             this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(16, 50);
+            this.label4.Location = new System.Drawing.Point(11, 33);
+            this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(80, 18);
+            this.label4.Size = new System.Drawing.Size(53, 12);
             this.label4.TabIndex = 1003;
             this.label4.Text = "数 据 源";
             // 
@@ -166,23 +179,26 @@
             // 
             this.cbo_sjy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.cbo_sjy.FormattingEnabled = true;
-            this.cbo_sjy.Location = new System.Drawing.Point(102, 46);
+            this.cbo_sjy.Location = new System.Drawing.Point(68, 31);
+            this.cbo_sjy.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.cbo_sjy.Name = "cbo_sjy";
-            this.cbo_sjy.Size = new System.Drawing.Size(426, 26);
+            this.cbo_sjy.Size = new System.Drawing.Size(285, 20);
             this.cbo_sjy.TabIndex = 50;
             // 
             // panel_container
             // 
-            this.panel_container.Location = new System.Drawing.Point(99, 282);
+            this.panel_container.Location = new System.Drawing.Point(66, 188);
+            this.panel_container.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.panel_container.Name = "panel_container";
-            this.panel_container.Size = new System.Drawing.Size(26, 32);
+            this.panel_container.Size = new System.Drawing.Size(17, 21);
             this.panel_container.TabIndex = 5;
             // 
             // button3
             // 
-            this.button3.Location = new System.Drawing.Point(610, 44);
+            this.button3.Location = new System.Drawing.Point(407, 29);
+            this.button3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.button3.Name = "button3";
-            this.button3.Size = new System.Drawing.Size(98, 30);
+            this.button3.Size = new System.Drawing.Size(65, 20);
             this.button3.TabIndex = 40;
             this.button3.Text = "打开文件";
             this.button3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -192,9 +208,10 @@
             // 
             // btn_preview
             // 
-            this.btn_preview.Location = new System.Drawing.Point(468, 478);
+            this.btn_preview.Location = new System.Drawing.Point(312, 319);
+            this.btn_preview.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.btn_preview.Name = "btn_preview";
-            this.btn_preview.Size = new System.Drawing.Size(110, 40);
+            this.btn_preview.Size = new System.Drawing.Size(73, 27);
             this.btn_preview.TabIndex = 80;
             this.btn_preview.Text = "打开报表";
             this.btn_preview.UseVisualStyleBackColor = true;
@@ -208,21 +225,31 @@
             // 
             // button7
             // 
-            this.button7.Location = new System.Drawing.Point(351, 478);
-            this.button7.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.button7.Location = new System.Drawing.Point(234, 319);
             this.button7.Name = "button7";
-            this.button7.Size = new System.Drawing.Size(110, 40);
+            this.button7.Size = new System.Drawing.Size(73, 27);
             this.button7.TabIndex = 1008;
             this.button7.Text = "国标导出";
             this.button7.UseVisualStyleBackColor = true;
             this.button7.Click += new System.EventHandler(this.button7_Click);
             // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(93, 319);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(75, 23);
+            this.button1.TabIndex = 1009;
+            this.button1.Text = "button1";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
             // OTSReport_Export
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(704, 500);
+            this.ClientSize = new System.Drawing.Size(473, 345);
             this.ControlBox = false;
+            this.Controls.Add(this.button1);
             this.Controls.Add(this.button7);
             this.Controls.Add(this.cbo_sjy);
             this.Controls.Add(this.label4);
@@ -241,10 +268,11 @@
             this.Controls.Add(this.richTextBox1);
             this.Controls.Add(this.panel_container);
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.MaximizeBox = false;
-            this.MaximumSize = new System.Drawing.Size(726, 556);
+            this.MaximumSize = new System.Drawing.Size(489, 384);
             this.MinimizeBox = false;
-            this.MinimumSize = new System.Drawing.Size(726, 556);
+            this.MinimumSize = new System.Drawing.Size(489, 384);
             this.Name = "OTSReport_Export";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
             this.Text = "报告程序输出界面";
@@ -276,5 +304,6 @@
         private System.Windows.Forms.Button btn_preview;
         public System.ComponentModel.BackgroundWorker backgroundWorker2;
         private System.Windows.Forms.Button button7;
+        private System.Windows.Forms.Button button1;
     }
 }

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

@@ -15,6 +15,8 @@ using System.IO;
 using System.Linq;
 using System.Windows.Forms;
 using System.Xml;
+using OTSIncAReportApp._1_UI.OTSTemplateDesigner;
+using DevExpress.XtraReports.UI;
 
 namespace OTSIncAReportApp
 {
@@ -613,6 +615,7 @@ namespace OTSIncAReportApp
             //颗粒分析结果
             m_mbszclass.M_KLFXJG.b_ck_klcc_xsmk = Convert.ToBoolean(xmlutil2.Read("M_KLFXJG", "b_ck_klcc_xsmk"));//是否显示模块
             m_mbszclass.M_KLFXJG.index_cb_klcc_jsfs = Convert.ToInt32(xmlutil2.Read("M_KLFXJG", "index_cb_klcc_jsfs"));//计算方式
+            m_mbszclass.M_KLFXJG.str_cb_klcc_jsfs = Convert.ToString(xmlutil2.Read("M_KLFXJG", "str_cb_klcc_jsfs"));//计算方式
             m_mbszclass.M_KLFXJG.index_cb_klcc_ljb = Convert.ToInt32(xmlutil2.Read("M_KLFXJG", "index_cb_klcc_ljb"));//粒级表
             m_mbszclass.M_KLFXJG.index_cb_klcc_klfw = Convert.ToInt32(xmlutil2.Read("M_KLFXJG", "index_cb_klcc_klfw"));//颗粒范围
             m_mbszclass.M_KLFXJG.b_cb_jzwfl_xsmk = Convert.ToBoolean(xmlutil2.Read("M_KLFXJG", "b_cb_jzwfl_xsmk"));//是否显示该模块
@@ -1845,7 +1848,7 @@ namespace OTSIncAReportApp
             #region //获取模板设置的导出的内容-------------------------------------------------
 
             //获取报告模板设置内容
-            worker.ReportProgress(0, table["rictbox4"].ToString());
+            worker.ReportProgress(0, table["rictbox4"].ToString());//已获取模板中设置内容为:
             System.Threading.Thread.Sleep(1);
             //更新进度
             worker.ReportProgress(5);
@@ -1859,126 +1862,126 @@ namespace OTSIncAReportApp
             i_zz = 80 / 9;
 
             //首先将测量结果信息表导出,在表头------------------------------------------------
-            worker.ReportProgress(0, table["rictbox5"].ToString());
-            worker.ReportProgress(0, table["rictbox6"].ToString());
+            worker.ReportProgress(0, table["rictbox5"].ToString());//加载测量结果信息表模块中....
+            worker.ReportProgress(0, table["rictbox6"].ToString());//加载:测量结果信息表
             //更新进度条
             processvalue = processvalue + 1;
             worker.ReportProgress(processvalue);
             lock (m_thread_flag)
-                m_thread_flag = table["rictbox7"].ToString();
-            while (m_thread_flag == table["rictbox7"].ToString())
+                m_thread_flag = table["rictbox7"].ToString();//等待
+            while (m_thread_flag == table["rictbox7"].ToString())//等待
             {
                 System.Threading.Thread.Sleep(500);
             }
-            worker.ReportProgress(0, table["rictbox8"].ToString());
+            worker.ReportProgress(0, table["rictbox8"].ToString());//加载测量结果信息表模块完成
             //-------------------------------------------------------------------------
 
             //调用输出,颗粒列表----------------------------------------
-            worker.ReportProgress(0, table["rictbox9"].ToString());
-            worker.ReportProgress(0, table["rictbox10"].ToString());
+            worker.ReportProgress(0, table["rictbox9"].ToString());//加载颗粒列表模块中....
+            worker.ReportProgress(0, table["rictbox10"].ToString());//加载:颗粒列表
             //更新进度条
             processvalue = processvalue + i_zz;
             worker.ReportProgress(processvalue);
             lock (m_thread_flag)
-                m_thread_flag = table["rictbox7"].ToString();
-            while (m_thread_flag == table["rictbox7"].ToString())
+                m_thread_flag = table["rictbox7"].ToString();//等待
+            while (m_thread_flag == table["rictbox7"].ToString())//等待
             {
                 System.Threading.Thread.Sleep(500);
             }
-            worker.ReportProgress(0, table["rictbox14"].ToString());
+            worker.ReportProgress(0, table["rictbox14"].ToString());//加载颗粒列表模块完成
 
 
 
             //调用输出,平均元素含量表---------------------------------------
-            worker.ReportProgress(0, table["rictbox15"].ToString());
-            worker.ReportProgress(0, table["rictbox16"].ToString());
+            worker.ReportProgress(0, table["rictbox15"].ToString());//加载平均元素含量表模块中....
+            worker.ReportProgress(0, table["rictbox16"].ToString());//加载:平均元素含量表
             //更新进度条
             processvalue = processvalue + i_zz;
             worker.ReportProgress(processvalue);
             lock (m_thread_flag)
-                m_thread_flag = table["rictbox7"].ToString();
-            while (m_thread_flag == table["rictbox7"].ToString())
+                m_thread_flag = table["rictbox7"].ToString(); //等待
+            while (m_thread_flag == table["rictbox7"].ToString())//等待
             {
                 System.Threading.Thread.Sleep(500);
             }
-            worker.ReportProgress(0, table["rictbox17"].ToString());
+            worker.ReportProgress(0, table["rictbox17"].ToString());//加载平均元素含量表模块完成
 
 
 
             //调用输出,颗粒尺寸表--------------------------------------
-            worker.ReportProgress(0, table["rictbox19"].ToString());
-            worker.ReportProgress(0, table["rictbox20"].ToString());
+            worker.ReportProgress(0, table["rictbox19"].ToString());//加载颗粒尺寸表模块中....
+            worker.ReportProgress(0, table["rictbox20"].ToString());//加载:颗粒尺寸表
             //更新进度条
             processvalue = processvalue + i_zz;
             worker.ReportProgress(processvalue);
             lock (m_thread_flag)
-                m_thread_flag = table["rictbox7"].ToString();
-            while (m_thread_flag == table["rictbox7"].ToString())
+                m_thread_flag = table["rictbox7"].ToString();//等待
+            while (m_thread_flag == table["rictbox7"].ToString())//等待
             {
                 System.Threading.Thread.Sleep(500);
             }
-            worker.ReportProgress(0, table["rictbox21"].ToString());
+            worker.ReportProgress(0, table["rictbox21"].ToString());//加载颗粒尺寸表模块完成
 
 
 
 
             //调用,颗粒成份图------------------------------------------------
-            worker.ReportProgress(0, table["rictbox23"].ToString());
-            worker.ReportProgress(0, table["rictbox24"].ToString());
+            worker.ReportProgress(0, table["rictbox23"].ToString());//加载颗粒成份图模块中....
+            worker.ReportProgress(0, table["rictbox24"].ToString());//加载:颗粒成份图
             //更新进度条
             processvalue = processvalue + i_zz;
             worker.ReportProgress(processvalue);
             lock (m_thread_flag)
-                m_thread_flag = table["rictbox7"].ToString();
-            while (m_thread_flag == table["rictbox7"].ToString())
+                m_thread_flag = table["rictbox7"].ToString();//等待
+            while (m_thread_flag == table["rictbox7"].ToString())//等待
             {
                 System.Threading.Thread.Sleep(500);
             }
-            worker.ReportProgress(0, table["rictbox25"].ToString());
+            worker.ReportProgress(0, table["rictbox25"].ToString());//加载颗粒成份图模块完成
 
             //调用,元素成份图---------------------------------------------
-            worker.ReportProgress(0, table["rictbox27"].ToString());
-            worker.ReportProgress(0, table["rictbox28"].ToString());
+            worker.ReportProgress(0, table["rictbox27"].ToString());//加载元素成份图模块中....
+            worker.ReportProgress(0, table["rictbox28"].ToString());//加载:元素成份图
             //更新进度条
             processvalue = processvalue + i_zz;
             worker.ReportProgress(processvalue);
             lock (m_thread_flag)
-                m_thread_flag = table["rictbox7"].ToString();
-            while (m_thread_flag == table["rictbox7"].ToString())
+                m_thread_flag = table["rictbox7"].ToString();//等待
+            while (m_thread_flag == table["rictbox7"].ToString())//等待
             {
                 System.Threading.Thread.Sleep(500);
             }
-            worker.ReportProgress(0, table["rictbox29"].ToString());
+            worker.ReportProgress(0, table["rictbox29"].ToString());//加载元素成份图模块完成
 
 
             //调用,三元相图----------------------------------------------
-            worker.ReportProgress(0, table["rictbox31"].ToString());
-            worker.ReportProgress(0, table["rictbox32"].ToString());
+            worker.ReportProgress(0, table["rictbox31"].ToString());//加载三元相图模块中....
+            worker.ReportProgress(0, table["rictbox32"].ToString());//加载:三元相图
             //更新进度条
             processvalue = processvalue + i_zz;
             worker.ReportProgress(processvalue);
             lock (m_thread_flag)
-                m_thread_flag = table["rictbox7"].ToString();
-            while (m_thread_flag == table["rictbox7"].ToString())
+                m_thread_flag = table["rictbox7"].ToString();//等待
+            while (m_thread_flag == table["rictbox7"].ToString())//等待
             {
                 System.Threading.Thread.Sleep(500);
             }
-            worker.ReportProgress(0, table["rictbox33"].ToString());
+            worker.ReportProgress(0, table["rictbox33"].ToString());//加载三元相图模块完成
 
 
             //生成,模板临时数据库文件----------------------------------------------
-            worker.ReportProgress(0, table["rictbox35"].ToString());
-            worker.ReportProgress(0, table["rictbox36"].ToString());
+            worker.ReportProgress(0, table["rictbox35"].ToString());//生成模板临时数据库文件....
+            worker.ReportProgress(0, table["rictbox36"].ToString());//加载:生成模板临时数据库文件
             //更新进度条
             processvalue = processvalue + i_zz;
             worker.ReportProgress(processvalue);
             lock (m_thread_flag)
-                m_thread_flag = table["rictbox7"].ToString();
-            while (m_thread_flag == table["rictbox7"].ToString())
+                m_thread_flag = table["rictbox7"].ToString();//等待
+            while (m_thread_flag == table["rictbox7"].ToString())//等待
             {
                 System.Threading.Thread.Sleep(500);
             }
-            worker.ReportProgress(0, table["rictbox37"].ToString());
+            worker.ReportProgress(0, table["rictbox37"].ToString());//模板临时数据库文件完成
 
             #endregion 依将循环调用各功能模块结束-------------------------------------------------------
         }
@@ -2005,18 +2008,18 @@ namespace OTSIncAReportApp
             {
                 string ls_str = (string)e.UserState;
                 WriteRictBox((string)e.UserState);
-                
-             string s=  AnalyticGraphics(m_mbszclass.M_KLFXJG.index_cb_jzwfl_xstx);
-                if (ls_str.IndexOf(table["rictbox12"].ToString()) > -1)
+
+                string s = AnalyticGraphics(m_mbszclass.M_KLFXJG.index_cb_jzwfl_xstx);
+                if (ls_str.IndexOf(table["rictbox12"].ToString()) > -1)//加载:
                 {
-                    if (ls_str.IndexOf(table["rictbox11"].ToString()) > -1)
+                    if (ls_str.IndexOf(table["rictbox11"].ToString()) > -1)//测量结果信息表
                     {
                         //m_export_reporttemplate.GetDBData();
                         m_export_reporttemplate.InsertReportTemplateTable_ResultGrid();
                         lock (m_thread_flag)
                             m_thread_flag = strNill;
                     }
-                    if (ls_str.IndexOf(table["rictbox13"].ToString()) > -1)
+                    if (ls_str.IndexOf(table["rictbox13"].ToString()) > -1)//颗粒列表
                     {
                         //判断颗粒列表是否导出
                         if (m_mbszclass.M_KLLBXX.b_ck_kllb_xsmk)
@@ -2028,7 +2031,7 @@ namespace OTSIncAReportApp
                             m_thread_flag = strNill;
                     }
 
-                    if (ls_str.IndexOf(table["rictbox18"].ToString()) > -1)
+                    if (ls_str.IndexOf(table["rictbox18"].ToString()) > -1)//平均元素含量表
                     {
                         m_export_reporttemplate.InsertReportTemplateTable_ElementAvgGrid(m_mbszclass);
                         m_export_reporttemplate.InsertReportTemplateChart_InclusionAreaClassRatio("pie", m_mbszclass);
@@ -2040,27 +2043,27 @@ namespace OTSIncAReportApp
                             m_thread_flag = strNill;
                     }
 
-                    if (ls_str.IndexOf(table["rictbox22"].ToString()) > -1)
+                    if (ls_str.IndexOf(table["rictbox22"].ToString()) > -1)//颗粒尺寸表
                     {
                         m_export_reporttemplate.InsertReportTemplateTable_ParticleSizeGrid(m_mbszclass);
                         lock (m_thread_flag)
                             m_thread_flag = strNill;
                     }
 
-                    if (ls_str.IndexOf(table["rictbox26"].ToString()) > -1)
+                    if (ls_str.IndexOf(table["rictbox26"].ToString()) > -1)//颗粒成份图
                     {
                         //m_export_reporttemplate.InsertReportTemplateChart_ParticlesCompositionChart(AnalyticGraphics(m_mbszclass.M_KLFXJG.index_cb_jzwfl_xstx));
                         lock (m_thread_flag)
                             m_thread_flag = strNill;
                     }
-                    if (ls_str.IndexOf(table["rictbox30"].ToString()) > -1)
+                    if (ls_str.IndexOf(table["rictbox30"].ToString()) > -1)//元素成份图
                     {
                      //   m_export_reporttemplate.InsertReportTemplateChart_ElementCompositionChart(AnalyticGraphics(m_mbszclass.M_YSFXJG.index_cb_yscf_xstx));
                         lock (m_thread_flag)
                             m_thread_flag = strNill;
                     }
 
-                    if (ls_str.IndexOf(table["rictbox34"].ToString()) > -1)
+                    if (ls_str.IndexOf(table["rictbox34"].ToString()) > -1)//三元相图
                     {
                         //三元图部分
                         if (m_mbszclass.M_SYXT.b_ck_syxt_xsmk)
@@ -2069,7 +2072,7 @@ namespace OTSIncAReportApp
                             m_thread_flag = strNill;
                     }
 
-                    if (ls_str.IndexOf(table["rictbox38"].ToString()) > -1)
+                    if (ls_str.IndexOf(table["rictbox38"].ToString()) > -1)//生成模板临时数据库文件
                     {
                         //导出到数据库文件中
                         SaveReportTemplateDBFile();
@@ -2601,6 +2604,44 @@ namespace OTSIncAReportApp
         {
            
         }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            OTS_DEVReport DEVReport = new OTS_DEVReport(this);
+            //DEVReport.Dispose();
+            //DEVReport = new OTS_DEVReport(this);
+            DEVReport.setResultGrid(m_mbszclass);
+            DEVReport.setParticleSizeTable(m_mbszclass);
+            DEVReport.setElementAvgGrid(m_mbszclass);
+            DEVReport.setINCAtable(m_mbszclass);
+            DEVReport.set_incaPIC_classify(m_mbszclass);
+            DEVReport.set_incaPIC_subdivision(m_mbszclass);
+
+          //  DEVReport.InsertReportTemplateChart_Trianglediagram(m_mbszclass);
+            DEVReport.set_kllb_data(m_mbszclass);
+
+
+            DEVReport.set_kllb_data_frame(m_mbszclass);
+            DEVReport.International_language(dev_internationalLanguage());
+
+
+            ReportPrintTool tool = new ReportPrintTool(DEVReport);
+            tool.ShowPreview();
+
+          
+        }
+
+          /// <summary>
+        /// 从数据库中读取语言配置信息
+        /// </summary>
+        /// <returns></returns>
+        private DataTable dev_internationalLanguage()
+        {
+            string Language = "ZH";
+            OTSCommon.SqLiteHelper sh = new OTSCommon.SqLiteHelper("data source='" + System.IO.Directory.GetCurrentDirectory() + "\\Resources\\ReportTemplate\\language.db'");
+            DataTable dt_stl = sh.ExecuteQuery("select * from "+ Language);
+            return dt_stl;
+        }
     }
     
 }

+ 2 - 0
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_TemplateDesignerRM.cs

@@ -251,6 +251,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 //颗粒分析结果
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLFXJG.b_ck_klcc_xsmk.ToString(), "M_KLFXJG", "b_ck_klcc_xsmk");//是否显示模块
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_klcc_jsfs.ToString(), "M_KLFXJG", "index_cb_klcc_jsfs");//计算方式
+                xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_klcc_jsfs.ToString(), "M_KLFXJG", "str_cb_klcc_jsfs");//计算方式
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_klcc_ljb.ToString(), "M_KLFXJG", "index_cb_klcc_ljb");//粒级表
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_klcc_klfw.ToString(), "M_KLFXJG", "index_cb_klcc_klfw");//颗粒范围
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLFXJG.b_cb_jzwfl_xsmk.ToString(), "M_KLFXJG", "b_cb_jzwfl_xsmk");//是否显示该模块
@@ -435,6 +436,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 //颗粒分析结果
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLFXJG.b_ck_klcc_xsmk.ToString(), "M_KLFXJG", "b_ck_klcc_xsmk");//是否显示模块
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_klcc_jsfs.ToString(), "M_KLFXJG", "index_cb_klcc_jsfs");//计算方式
+                xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_klcc_jsfs.ToString(), "M_KLFXJG", "str_cb_klcc_jsfs");//计算方式
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_klcc_ljb.ToString(), "M_KLFXJG", "index_cb_klcc_ljb");//粒级表
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_klcc_klfw.ToString(), "M_KLFXJG", "index_cb_klcc_klfw");//颗粒范围
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLFXJG.b_cb_jzwfl_xsmk.ToString(), "M_KLFXJG", "b_cb_jzwfl_xsmk");//是否显示该模块

+ 2 - 0
OTSIncAReportApp/1-UI/frmReportApp.cs

@@ -125,6 +125,8 @@ namespace OTSIncAReportApp
         /// </summary>
         public OTSIncAReportGrids.ParticlesGridDevidePage im_ParticlesGridDevidePage = null;
 
+
+
         /// <summary>
         /// 颗粒成份分布表
         /// </summary>

+ 9 - 2
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -445,8 +445,15 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
                 particlesAll.Columns.Add("Element");
             }
             //particlesAll = GetInfoForPartucleDevidePage2("");
-
-            DataTable elementchemistry = GetElementChemistry();
+            DataTable dt_element = GetElementChemistry();
+            DataTable elementchemistry = dt_element.Clone();
+            for (int i=0;i< dt_element.Rows.Count;i++)
+            {
+                if (dt_element.Rows[i]["Name"].ToString()!="Fe")
+                {
+                    elementchemistry.Rows.Add(dt_element.Rows[i].ItemArray);
+                }
+            }
             for (int i = 0; i < particlesAll.Rows.Count; i++)
             {
                 string str = "XRayId = " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();

+ 28 - 0
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -176,6 +176,24 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\Bin\x64\Debug\CefSharp.WinForms.dll</HintPath>
     </Reference>
+    <Reference Include="DevExpress.Charts.v20.1.Core, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.Data.Desktop.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.Data.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.Office.v20.1.Core, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.Pdf.v20.1.Core, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.PivotGrid.v20.1.Core, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.Printing.v20.1.Core, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.RichEdit.v20.1.Core, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.RichEdit.v20.1.Export, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.Sparkline.v20.1.Core, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.Utils.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="DevExpress.Utils.v20.1.UI, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="DevExpress.XtraCharts.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.XtraEditors.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="DevExpress.XtraGauges.v20.1.Core, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.XtraPrinting.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="DevExpress.XtraReports.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.XtraReports.v20.1.Extensions, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
     <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
       <HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
     </Reference>
@@ -430,6 +448,12 @@
     <Compile Include="1-UI\Frm_UserProgress.designer.cs">
       <DependentUpon>Frm_UserProgress.cs</DependentUpon>
     </Compile>
+    <Compile Include="1-UI\OTSTemplateDesigner\OTS_DEVReport.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="1-UI\OTSTemplateDesigner\OTS_DEVReport.Designer.cs">
+      <DependentUpon>OTS_DEVReport.cs</DependentUpon>
+    </Compile>
     <Compile Include="2-CommonFunction\CommonClass\Baseobject.cs" />
     <Compile Include="2-CommonFunction\CommonClass\DisplayField.cs" />
     <Compile Include="2-CommonFunction\CommonClass\DisplayParticle.cs" />
@@ -712,6 +736,9 @@
     <EmbeddedResource Include="1-UI\OTSTemplateDesigner\OTSReport_TemplateDesignerRM.resx">
       <DependentUpon>OTSReport_TemplateDesignerRM.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="1-UI\OTSTemplateDesigner\OTS_DEVReport.resx">
+      <DependentUpon>OTS_DEVReport.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="1-UI\OutputNlog.resx">
       <DependentUpon>OutputNlog.cs</DependentUpon>
     </EmbeddedResource>
@@ -1263,6 +1290,7 @@
     <EmbeddedResource Include="Help.resx">
       <DependentUpon>Help.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Properties\licenses.licx" />
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>PublicResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>