Browse Source

修改报表元素分布表的格式,元素增加至14个元素,另外增加元素分布表已字符串的形式显示全部元素信息;增加国标导出报表功能;

zhangjiaxin 4 years ago
parent
commit
2d40c1c385

+ 2 - 2
Bin/x64/Debug/Config/ProData/ReportTemplateConfig.xml

@@ -27,7 +27,7 @@
   <M_YSFXJG>
     <b_ck_ysfx_xsmk>True</b_ck_ysfx_xsmk>
     <index_cb_yxfx_jsfs>0</index_cb_yxfx_jsfs>
-    <index_cb_ysfx_klfw>1</index_cb_ysfx_klfw>
+    <index_cb_ysfx_klfw>0</index_cb_ysfx_klfw>
     <str_tb_ysfx_xsys>O,Al,Mg,Ca,Ti,Si,S,Mn,N</str_tb_ysfx_xsys>
     <list_str_tb_ysfx_xsys>
       <YS0>O</YS0>
@@ -41,7 +41,7 @@
       <YS8>N</YS8>
     </list_str_tb_ysfx_xsys>
     <b_ck_yscf_xsmk>True</b_ck_yscf_xsmk>
-    <index_cb_yscf_xstx>1</index_cb_yscf_xstx>
+    <index_cb_yscf_xstx>2</index_cb_yscf_xstx>
     <index_cb_yscf_jsfs>0</index_cb_yscf_jsfs>
     <index_cb_yscf_klfw>0</index_cb_yscf_klfw>
     <str_tb_yscf_ysxx>H</str_tb_yscf_ysxx>

BIN
Bin/x64/Debug/Resources/ReportTemplate/GB.rmf


BIN
Bin/x64/Debug/Resources/ReportTemplate/group1.rmf


+ 8 - 7
OTSIncAReportApp/DataOperation/DataAccess/SqlHelper.cs

@@ -368,13 +368,14 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         /// <param name="colTypes">字段名类型</param>
         public DataTable CreateTable(string tableName, string[] colNames, string[] colTypes)
         {
-            string queryString = "CREATE TABLE IF NOT EXISTS " + tableName + "( " + colNames[0] + " " + colTypes[0];
-            for (int i = 1; i < colNames.Length; i++)
-            {
-                queryString += ", " + colNames[i] + " " + colTypes[i];
-            }
-            queryString += "  ) ";
-            return ExecuteQuery(queryString);
+                string queryString = "CREATE TABLE IF NOT EXISTS " + tableName + "( " + colNames[0] + " " + colTypes[0];
+                for (int i = 1; i < colNames.Length; i++)
+                {
+                    queryString += ", " + colNames[i] + " " + colTypes[i];
+                }
+                queryString += "  ) ";
+                return ExecuteQuery(queryString);
+         
         }
 
         /// <summary>

+ 2 - 5
OTSIncAReportApp/FunctionClass/OTSDataMgrFunction/DataMgrFun.cs

@@ -374,11 +374,8 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
                 string sSCaptionName10 = table["sscaptionname10"].ToString();
                 List<string> list2 = new List<string>() { table["sscaptionname25"].ToString(), table["sscaptionname26"].ToString(), table["sscaptionname27"].ToString(), table["sscaptionname28"].ToString(), table["sscaptionname29"].ToString(), table["sscaptionname30"].ToString()};
                 string[] aa = m_ReportApp.Text.Split('-');
-                if(aa[aa.Count()-1]== " Inclusion Analysis System")
-                {
-                    List<string> listStd = new List<string>() {"国标一", "国标二", "美标", "德标" };
-                    list2.AddRange(listStd);
-                }
+                List<string> listStd = new List<string>() { "国标一", "国标二", "美标", "德标" };
+                list2.AddRange(listStd);
                 SampleData sampleData3 = new SampleData();
                 sampleData3.iItemId = OTS_REPORT_PROP_GRID_ITEMS.CALCULATE_TABLE_TYPE;
                 sampleData3.sSCaptionName = sSCaptionName10;

+ 2 - 0
OTSIncAReportApp/FunctionClass/OTSDisplaySGridData/SampleGrid.cs

@@ -7,6 +7,7 @@ using SourceGrid;
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.Data;
 using System.Diagnostics;
 using System.Drawing;
 using System.Linq;
@@ -651,6 +652,7 @@ namespace OTSIncAReportApp.OTSDataMgrFunction
 
                             m_RstProp.m_ReportApp.m_CTablesWindow.Controls.Clear();
                             m_RstProp.m_ReportApp.im_ChineseStandardABCDDS = new ChineseStandardABCDDS(m_RstProp.m_ReportApp.m_DataMgrFun.m_ReportMgr, listGriddataclr);
+                            
                             m_RstProp.m_ReportApp.im_ChineseStandardABCDDS.Dock = DockStyle.Fill;
                             m_RstProp.m_ReportApp.m_CTablesWindow.Controls.Add(m_RstProp.m_ReportApp.im_ChineseStandardABCDDS);
                             m_RstProp.m_ReportApp.m_CTablesWindow.Activate();

+ 12 - 1
OTSIncAReportApp/GBCalculate/ChineseStandardABCDDS.cs

@@ -749,7 +749,18 @@ namespace OTSIncAReportGB
             return ret_dt;
         }
         #endregion
-
+        #region clr数据导出DataTable表
+        public List<DataTable> ChineseStandardABCD_GetDataTable()
+        {
+            List<DataTable> dataTables = new List<DataTable>();
+            dataTables.Add( ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_A, out m_oneresult_columnscount_A));
+            dataTables.Add( ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_B, out m_oneresult_columnscount_B));
+            dataTables.Add( ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_C, out m_oneresult_columnscount_C));
+            dataTables.Add( ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_D, out m_oneresult_columnscount_D));
+            dataTables.Add( ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_DS, out m_oneresult_columnscount_DS));
+            return dataTables;
+        }
+        #endregion
 
     }
 }

+ 13 - 2
OTSIncAReportApp/GBCalculate/NationalStandardMethodTwo.cs

@@ -971,8 +971,19 @@ namespace OTSIncAReportGB
             return ret_dt;
         }
         #endregion
-
-
+        #region 读取加载clr中的国标数据信息
+        public List<DataTable> ChineseStandardABCD_GetDataTable()
+        {
+            List<DataTable> dataTables = new List<DataTable>();
+            dataTables.Add(ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_A, out m_oneresult_columnscount_A));
+            dataTables.Add( ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_B, out m_oneresult_columnscount_B));
+            dataTables.Add( ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_C, out m_oneresult_columnscount_C));
+            dataTables.Add( ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_D, out m_oneresult_columnscount_D));
+            dataTables.Add( ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_sulfide, out m_oneresult_columnscount_sulfide));
+            dataTables.Add( ChineseStandardABCD_GetDataTable_Total(m_list_cgriddataclr_DS, out m_oneresult_columnscount_DS));
+            return dataTables;
+        }
+        #endregion
 
     }
 }

+ 10 - 1
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -190,6 +190,15 @@
     <Reference Include="OTS.WinFormsUI.Docking">
       <HintPath>..\Bin\x64\Debug\OTS.WinFormsUI.Docking.dll</HintPath>
     </Reference>
+    <Reference Include="RM.Interop.ReportMachine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c20d61f40d9b22e3, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <EmbedInteropTypes>True</EmbedInteropTypes>
+      <HintPath>..\Bin\x64\Debug\RM.Interop.ReportMachine.dll</HintPath>
+    </Reference>
+    <Reference Include="RM.ReportEngine, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\Bin\x64\Debug\RM.ReportEngine.dll</HintPath>
+    </Reference>
     <Reference Include="SourceGrid, Version=4.40.7083.30975, Culture=neutral, PublicKeyToken=df6f5e538749e85d, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\OpenDll\WordApiDll\SourceGrid.dll</HintPath>
@@ -210,6 +219,7 @@
     <Reference Include="System.Runtime.Serialization" />
     <Reference Include="System.ServiceModel" />
     <Reference Include="System.ServiceModel.Web" />
+    <Reference Include="System.ServiceProcess" />
     <Reference Include="System.Windows.Forms.DataVisualization" />
     <Reference Include="System.Windows.Forms.Ribbon, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
@@ -641,7 +651,6 @@
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     </EmbeddedResource>
     <None Include="Control_Graph\ClassDiagram1.cd" />
-    <None Include="Control_Grids\ClassDiagram1.cd" />
     <None Include="FunctionClass\ClassDiagram1.cd" />
     <None Include="packages.config" />
     <None Include="Properties\Settings.settings">

+ 66 - 21
OTSIncAReportApp/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -54,10 +54,9 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         /// 向 模板设计器 中插入测量结果Grid表格
         /// </summary>
         /// <returns></returns>
-        public bool InsertReportTemplateTable_ResultGrid()
+        public DataTable InsertReportTemplateTable_ResultGrid()
         {
-            try
-            {
+           
                 //------------------加载模块,获取数据-------------------------------------------------
                 ResultGrid ls_resultgrid = new ResultGrid(m_otsreport_export.m_ReportApp);
                 Dictionary<string, string> keyValues_ResultGrid = ls_resultgrid.GetData_ResultGrid();
@@ -69,7 +68,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 string str_FLFA = "";
                 string str_YJCTZ = "";
                 string str_SCMJ = "";
-                string str_CKBZ = "GB/130834-2014";
+                string str_CKBZ = "GB/T30834-2014";
 
                 keyValues_ResultGrid.TryGetValue(ls_resultgrid.table["col1"].ToString(), out str_CLJGMC);//测量结果名称
                 keyValues_ResultGrid.TryGetValue(ls_resultgrid.table["col4"].ToString(), out str_YXSJ);//运行时间
@@ -102,15 +101,12 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 ls_new_dt.Rows.Add(dr);
 
                 m_list_dt.Add(ls_new_dt);
-                return true;
-            }
-            catch (Exception ee)
-            {
-                string str = ee.ToString();
-                return false;
-            }
+                return ls_new_dt;
+            
         }
         #endregion
+       
+
 
         #region 插入颗粒列表并带有帧图
         /// <summary>
@@ -133,7 +129,6 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             //插入模板需父子表,结构
             //表名field_dt表:(父表)           帧图表
             DataTable DT_field_dt = new DataTable();
-            DT_field_dt = new DataTable();
             DT_field_dt.TableName = "field_dt";
             DataColumn colpictid2 = new DataColumn("FieldId");
             colpictid2.DataType = typeof(int);
@@ -574,9 +569,6 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             {
                 //加载模块
                 ElementCompositionAvgGrid ls_elementcompositionavggrid = new ElementCompositionAvgGrid(m_otsreport_export.m_ReportApp);
-                //List<string> vs = new List<string>() { "DMAX", "DMIN", "Area", "FERET" };
-                //ls_elementcompositionavggrid.condition = vs[m_otsreport_export.m_mbszclass.M_YSFXJG.index_cb_yxfx_jsfs];
-
                 m_otsreport_export.panel_container.Controls.Clear();
                 m_otsreport_export.panel_container.Controls.Add(ls_elementcompositionavggrid);
 
@@ -596,11 +588,16 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 ls_elementname_dt.Columns.Add("e7");
                 ls_elementname_dt.Columns.Add("e8");
                 ls_elementname_dt.Columns.Add("e9");
+                ls_elementname_dt.Columns.Add("e10");
+                ls_elementname_dt.Columns.Add("e11");
+                ls_elementname_dt.Columns.Add("e12");
+                ls_elementname_dt.Columns.Add("e13");
+                ls_elementname_dt.Columns.Add("e14");
 
                 DataRow dr = ls_elementname_dt.NewRow();
 
-                int col = 5;
-                for (int i = 1; i < 10; i++)
+                int col = 4;
+                for (int i = 1; i < 15; i++)
                 {
                     if (ls_gv.Columns.Count > col)
                         dr["e" + i.ToString()] = ls_gv.Columns[col++].Name;
@@ -619,8 +616,14 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 ls_element_dt.Columns.Add("e7");
                 ls_element_dt.Columns.Add("e8");
                 ls_element_dt.Columns.Add("e9");
+                ls_element_dt.Columns.Add("e10");
+                ls_element_dt.Columns.Add("e11");
+                ls_element_dt.Columns.Add("e12");
+                ls_element_dt.Columns.Add("e13");
+                ls_element_dt.Columns.Add("e14");
                 ls_element_dt.Columns.Add("PName");
                 ls_element_dt.Columns.Add("Count");
+                ls_element_dt.Columns.Add("AllElements");
 
                 for (int i = 0; i < ls_gv.Rows.Count; i++)
                 {
@@ -629,14 +632,23 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     dr2["Count"] = ls_gv.Rows[i].Cells[2].Value.ToString();
 
 
-                    int colq = 5;
-                    for (int j = 1; j < 10; j++)
+                    int colq = 4;
+                    for (int j = 1; j < 15; j++)
                     {
                         if (ls_gv.Columns.Count > colq)
                             dr2["e" + j.ToString()] = ls_gv.Rows[i].Cells[colq++].Tag.ToString();
                     }
+                    colq = 4;
+                    string AllElements=null;
+                    for (int j = 0; j < ls_gv.Rows[i].Cells.Count; j++)
+                    {
+                        if (ls_gv.Columns.Count > colq)
+                        {
+                            AllElements = AllElements+ ls_gv.Columns[colq].Name + "%="+ ls_gv.Rows[i].Cells[colq++].Tag.ToString()+";   ";
+                        }
 
-
+                    }
+                    dr2["AllElements"] = AllElements;
                     ls_element_dt.Rows.Add(dr2);
                 }
 
@@ -1175,7 +1187,40 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         }
 
         #endregion
-
+        /// <summary>
+        /// 国标一
+        /// </summary>
+        /// <returns></returns>
+        public List<DataTable> InsertReportTemplateTable_ChineseStandardABCDDS(OTSCLRINTERFACE.CPropParamClr cPropParamClr)
+        {
+            //得到国标一的DataTable表格
+            
+            cPropParamClr.SetDataSourceId(0);//
+            cPropParamClr.SetType(1);//table
+            cPropParamClr.SetCalTableType(6);//国标1                    
+            List<OTSCLRINTERFACE.CGridDataClr> listGriddataclr = m_otsreport_export.m_ReportApp.m_DataMgrFun.m_ReportMgr.GridDataTransfer(cPropParamClr);
+            m_otsreport_export.m_ReportApp.im_ChineseStandardABCDDS = new OTSIncAReportGB.ChineseStandardABCDDS(m_otsreport_export.m_ReportApp.m_DataMgrFun.m_ReportMgr, listGriddataclr);
+            m_otsreport_export.m_ReportApp.m_CTablesWindow.Controls.Clear();
+            //List<DataTable> GB_1 = m_otsreport_export.m_ReportApp.im_ChineseStandardABCDDS.ChineseStandardABCD_GetDataTable();
+            //string s = GB_1[0].Rows[0][0].ToString();
+            return m_otsreport_export.m_ReportApp.im_ChineseStandardABCDDS.ChineseStandardABCD_GetDataTable(); ;
+        }
+        /// <summary>
+        /// 国标二 
+        /// </summary>
+        /// <returns></returns>
+        public List<DataTable> InsertReportTemplateTable_NationalStandardMethodTwo(OTSCLRINTERFACE.CPropParamClr cPropParamClr)
+        {
+            //得到国标二的DataTable表格
+            
+            cPropParamClr.SetDataSourceId(0);//
+            cPropParamClr.SetType(1);//table
+            cPropParamClr.SetCalTableType(7);//国标2  
+            List<OTSCLRINTERFACE.CGridDataClr> listGriddataclr2 = m_otsreport_export.m_ReportApp.m_DataMgrFun.m_ReportMgr.GridDataTransfer(cPropParamClr);//
+            m_otsreport_export.m_ReportApp.m_CTablesWindow.Controls.Clear();
+            m_otsreport_export.m_ReportApp.im_NationalStandardMethodTwo = new OTSIncAReportGB.NationalStandardMethodTwo(m_otsreport_export.m_ReportApp.m_DataMgrFun.m_ReportMgr, listGriddataclr2);
+            return m_otsreport_export.m_ReportApp.im_NationalStandardMethodTwo.ChineseStandardABCD_GetDataTable();
+        }
     }
 
 

+ 65 - 119
OTSIncAReportApp/OTSTemplateDesigner/OTSReport_Export.Designer.cs

@@ -33,7 +33,6 @@
             this.progressBar1 = new System.Windows.Forms.ProgressBar();
             this.label2 = new System.Windows.Forms.Label();
             this.label3 = new System.Windows.Forms.Label();
-            this.btn_export = new System.Windows.Forms.Button();
             this.btn_exit = new System.Windows.Forms.Button();
             this.label1 = new System.Windows.Forms.Label();
             this.tb_lj = new System.Windows.Forms.TextBox();
@@ -43,66 +42,56 @@
             this.btn_TempDes = new System.Windows.Forms.Button();
             this.label4 = new System.Windows.Forms.Label();
             this.cbo_sjy = new System.Windows.Forms.ComboBox();
-            this.button1 = new System.Windows.Forms.Button();
             this.panel_container = new System.Windows.Forms.Panel();
-            this.button2 = new System.Windows.Forms.Button();
             this.button3 = new System.Windows.Forms.Button();
             this.btn_preview = new System.Windows.Forms.Button();
             this.backgroundWorker2 = new System.ComponentModel.BackgroundWorker();
-            this.button5 = new System.Windows.Forms.Button();
-            this.button4 = new System.Windows.Forms.Button();
-            this.button6 = new System.Windows.Forms.Button();
+            this.button7 = 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);
             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);
             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_export
-            // 
-            this.btn_export.Location = new System.Drawing.Point(458, 478);
-            this.btn_export.Name = "btn_export";
-            this.btn_export.Size = new System.Drawing.Size(112, 38);
-            this.btn_export.TabIndex = 80;
-            this.btn_export.Text = "导出";
-            this.btn_export.UseVisualStyleBackColor = true;
-            this.btn_export.Visible = false;
-            this.btn_export.Click += new System.EventHandler(this.button1_Click);
-            // 
             // btn_exit
             // 
-            this.btn_exit.Location = new System.Drawing.Point(583, 478);
+            this.btn_exit.Location = new System.Drawing.Point(389, 319);
+            this.btn_exit.Margin = new System.Windows.Forms.Padding(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;
@@ -111,27 +100,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);
             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);
             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;
@@ -141,17 +133,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);
             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);
             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;
@@ -160,9 +154,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);
             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;
@@ -172,9 +167,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 = "数 据 源";
             // 
@@ -182,45 +178,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);
             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;
             // 
-            // button1
-            // 
-            this.button1.Location = new System.Drawing.Point(12, 478);
-            this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(34, 30);
-            this.button1.TabIndex = 1006;
-            this.button1.Text = ".";
-            this.button1.UseVisualStyleBackColor = true;
-            this.button1.Visible = false;
-            this.button1.Click += new System.EventHandler(this.button1_Click_1);
-            // 
             // 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);
             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;
             // 
-            // button2
-            // 
-            this.button2.Location = new System.Drawing.Point(52, 478);
-            this.button2.Name = "button2";
-            this.button2.Size = new System.Drawing.Size(34, 30);
-            this.button2.TabIndex = 1006;
-            this.button2.Text = "..";
-            this.button2.UseVisualStyleBackColor = true;
-            this.button2.Visible = false;
-            this.button2.Click += new System.EventHandler(this.button2_Click_1);
-            // 
             // 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);
             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;
@@ -230,9 +207,10 @@
             // 
             // btn_preview
             // 
-            this.btn_preview.Location = new System.Drawing.Point(458, 478);
+            this.btn_preview.Location = new System.Drawing.Point(312, 319);
+            this.btn_preview.Margin = new System.Windows.Forms.Padding(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;
@@ -244,49 +222,23 @@
             this.backgroundWorker2.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker2_ProgressChanged);
             this.backgroundWorker2.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker2_RunWorkerCompleted);
             // 
-            // button5
-            // 
-            this.button5.Location = new System.Drawing.Point(92, 476);
-            this.button5.Name = "button5";
-            this.button5.Size = new System.Drawing.Size(42, 34);
-            this.button5.TabIndex = 1007;
-            this.button5.Text = "设计";
-            this.button5.UseVisualStyleBackColor = true;
-            this.button5.Visible = false;
-            this.button5.Click += new System.EventHandler(this.button5_Click);
-            // 
-            // button4
-            // 
-            this.button4.Location = new System.Drawing.Point(140, 474);
-            this.button4.Name = "button4";
-            this.button4.Size = new System.Drawing.Size(38, 38);
-            this.button4.TabIndex = 1007;
-            this.button4.Text = "查看";
-            this.button4.UseVisualStyleBackColor = true;
-            this.button4.Visible = false;
-            this.button4.Click += new System.EventHandler(this.button4_Click);
-            // 
-            // button6
-            // 
-            this.button6.Location = new System.Drawing.Point(182, 478);
-            this.button6.Name = "button6";
-            this.button6.Size = new System.Drawing.Size(112, 38);
-            this.button6.TabIndex = 80;
-            this.button6.Text = "打印设置";
-            this.button6.UseVisualStyleBackColor = true;
-            this.button6.Visible = false;
-            this.button6.Click += new System.EventHandler(this.button6_Click);
+            // button7
+            // 
+            this.button7.Location = new System.Drawing.Point(234, 319);
+            this.button7.Name = "button7";
+            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);
             // 
             // 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(706, 510);
+            this.ClientSize = new System.Drawing.Size(475, 351);
             this.ControlBox = false;
-            this.Controls.Add(this.button5);
-            this.Controls.Add(this.button4);
-            this.Controls.Add(this.button2);
-            this.Controls.Add(this.button1);
+            this.Controls.Add(this.button7);
             this.Controls.Add(this.cbo_sjy);
             this.Controls.Add(this.label4);
             this.Controls.Add(this.btn_TempDes);
@@ -296,9 +248,7 @@
             this.Controls.Add(this.tb_mblj);
             this.Controls.Add(this.tb_lj);
             this.Controls.Add(this.btn_exit);
-            this.Controls.Add(this.button6);
             this.Controls.Add(this.btn_preview);
-            this.Controls.Add(this.btn_export);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.label3);
@@ -306,10 +256,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);
             this.MaximizeBox = false;
-            this.MaximumSize = new System.Drawing.Size(728, 566);
+            this.MaximumSize = new System.Drawing.Size(491, 390);
             this.MinimizeBox = false;
-            this.MinimumSize = new System.Drawing.Size(728, 566);
+            this.MinimumSize = new System.Drawing.Size(491, 390);
             this.Name = "OTSReport_Export";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
             this.Text = "报告程序输出界面";
@@ -326,7 +277,6 @@
         private System.Windows.Forms.ProgressBar progressBar1;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.Button btn_export;
         private System.Windows.Forms.Button btn_exit;
         private System.Windows.Forms.Label label1;
         public System.Windows.Forms.TextBox tb_lj;
@@ -336,14 +286,10 @@
         private System.Windows.Forms.Button btn_TempDes;
         private System.Windows.Forms.Label label4;
         private System.Windows.Forms.ComboBox cbo_sjy;
-        private System.Windows.Forms.Button button1;
         public System.Windows.Forms.Panel panel_container;
-        private System.Windows.Forms.Button button2;
         private System.Windows.Forms.Button button3;
         private System.Windows.Forms.Button btn_preview;
         public System.ComponentModel.BackgroundWorker backgroundWorker2;
-        private System.Windows.Forms.Button button5;
-        private System.Windows.Forms.Button button4;
-        private System.Windows.Forms.Button button6;
+        private System.Windows.Forms.Button button7;
     }
 }

+ 406 - 37
OTSIncAReportApp/OTSTemplateDesigner/OTSReport_Export.cs

@@ -19,13 +19,14 @@ namespace OTSIncAReportApp
 {
     public partial class OTSReport_Export : Form
     {
-
+        
         #region 全局变量
         public string m_thread_flag = "无";                             //线程操作的标识
         public string m_str_tmpbitmappath = "d:\\1.bmp";                //存放临时图片 的路径名和文件名
         public string m_str_tmpbitmappath2 = "d:\\2.bmp";
         public string m_str_tmpdocxpath = "d:\\1.doc";
         public string m_strDBpath = "";                                 //报表模板数据库文件
+        public string m_strDBpathGB = "";                               //报告国标导出
         public string m_strDBpath_ParticleList = "";                    //报表模板,颗粒列表数据库文件
 
         public frmReportApp m_ReportApp = null;                         //报告项目总进程对象
@@ -37,6 +38,7 @@ namespace OTSIncAReportApp
         public XmlConfigUtil xmlutil;
         public XmlConfigUtil xmlutil2;
         public MBSZClass m_mbszclass = null;
+        
         #endregion
 
         #region 条件参数变量
@@ -841,6 +843,9 @@ namespace OTSIncAReportApp
 
         private void OTSReport_Export_Load(object sender, EventArgs e)
         {
+           
+
+
             //先获取D盘,如果没有,则再获取C盘
             string str_drivename = GetSecondDriveName();
             if (str_drivename == "")
@@ -858,11 +863,15 @@ namespace OTSIncAReportApp
             //确定报表进程db数据库的路径
             string strdbname = "ReportTemplateDB.db";
             m_strDBpath = m_ReportApp.resultFilesList[cbo_sjy.SelectedIndex].FilePath;
+            m_strDBpathGB = m_ReportApp.resultFilesList[cbo_sjy.SelectedIndex].FilePath;
             m_strDBpath = m_strDBpath + "\\" + strdbname;
+            m_strDBpathGB = m_strDBpathGB + "\\" + "ReportGBDB.db";
 
             string strdbparticlelistname = "ReportTemplateDBParticleList.db";
             m_strDBpath_ParticleList = m_ReportApp.resultFilesList[cbo_sjy.SelectedIndex].FilePath;
             m_strDBpath_ParticleList = m_strDBpath_ParticleList + "\\" + strdbparticlelistname;
+
+           
         }
         #endregion
 
@@ -1200,8 +1209,7 @@ namespace OTSIncAReportApp
 
         private void button4_Click(object sender, EventArgs e)
         {
-            //打开报告模板进程
-            OpenOTSINcAreportTemplateAPP();
+          
         }
 
         private void btn_preview_Click(object sender, EventArgs e)
@@ -1292,13 +1300,7 @@ namespace OTSIncAReportApp
 
         private void button6_Click(object sender, EventArgs e)
         {
-            //预览设置
-            OTSReport_TemplateDesignerRM OtsTemDRM = new OTSReport_TemplateDesignerRM(this);
-            if (OtsTemDRM.ShowDialog() == DialogResult.Yes)
-            {
-                //如果用户点击确定,则将m_mbszclass,模板设置类的内容存到文件中。
-                SaveMBSClass();
-            }
+           
         }
 
 
@@ -1352,25 +1354,7 @@ namespace OTSIncAReportApp
 
         #endregion
 
-        #region 相关测试代码
-        private void button1_Click_1(object sender, EventArgs e)
-        {
-
-        }
-
-        private void button2_Click_1(object sender, EventArgs e)
-        {
-
-        }
-
-        private void button5_Click(object sender, EventArgs e)
-        {
-          
-        }
-
-
-
-        #endregion
+        
 
         #region 将报表数据保存到数据库中
         /// <summary>
@@ -1421,13 +1405,13 @@ namespace OTSIncAReportApp
 
 
                 //创建表 ElementName
-                string[] strcolumns_ElementName = { "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9" };
-                string[] strcoltypes_ElementName = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
+                string[] strcolumns_ElementName = { "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9","e10","e11","e12","e13","e14" };
+                string[] strcoltypes_ElementName = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
                 sh.CreateTable("ElementName", strcolumns_ElementName, strcoltypes_ElementName);
 
                 //创建表 ElementValue
-                string[] strcolumns_ElementValue = { "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "PName", "Count" };
-                string[] strcoltypes_ElementValue = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
+                string[] strcolumns_ElementValue = { "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9","e10","e11","e12","e13","e14", "PName", "Count" , "AllElements" };
+                string[] strcoltypes_ElementValue = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
                 sh.CreateTable("ElementValue", strcolumns_ElementValue, strcoltypes_ElementValue);
 
                 //创建表 PartSize
@@ -1586,7 +1570,7 @@ namespace OTSIncAReportApp
                 DataTable ls_ElementName = list_dt.Where(aa => aa.TableName.Contains("ElementName")).ToList()[0];
                 for (int i = 0; i < ls_ElementName.Rows.Count; i++)
                 {
-                    string ls_sqlstr = "insert into ElementName (e1, e2, e3, e4, e5, e6, e7, e8, e9 ) values('"
+                    string ls_sqlstr = "insert into ElementName (e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14 ) values('"
                         + ls_ElementName.Rows[i][0].ToString() + "','"
                         + ls_ElementName.Rows[i][1].ToString() + "','"
                         + ls_ElementName.Rows[i][2].ToString() + "','"
@@ -1595,7 +1579,12 @@ namespace OTSIncAReportApp
                         + ls_ElementName.Rows[i][5].ToString() + "','"
                         + ls_ElementName.Rows[i][6].ToString() + "','"
                         + ls_ElementName.Rows[i][7].ToString() + "','"
-                        + ls_ElementName.Rows[i][8].ToString() + "')";
+                        + ls_ElementName.Rows[i][8].ToString() + "','"
+                        + ls_ElementName.Rows[i][9].ToString() + "','"
+                        + ls_ElementName.Rows[i][10].ToString() + "','"
+                        + ls_ElementName.Rows[i][11].ToString() + "','"
+                        + ls_ElementName.Rows[i][12].ToString() + "','"
+                        + ls_ElementName.Rows[i][13].ToString() + "')";
                     int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
                 }
 
@@ -1603,7 +1592,7 @@ namespace OTSIncAReportApp
                 DataTable ls_ElementValue = list_dt.Where(aa => aa.TableName.Contains("ElementValue")).ToList()[0];
                 for (int i = 0; i < ls_ElementValue.Rows.Count; i++)
                 {
-                    string ls_sqlstr = "insert into ElementValue (e1, e2, e3, e4, e5, e6, e7, e8, e9,PName,Count ) values('"
+                    string ls_sqlstr = "insert into ElementValue (e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14,PName,Count,AllElements ) values('"
                         + ls_ElementValue.Rows[i][0].ToString() + "','"
                          + ls_ElementValue.Rows[i][1].ToString() + "','"
                           + ls_ElementValue.Rows[i][2].ToString() + "','"
@@ -1614,7 +1603,13 @@ namespace OTSIncAReportApp
                              + ls_ElementValue.Rows[i][7].ToString() + "','"
                              + ls_ElementValue.Rows[i][8].ToString() + "','"
                            + ls_ElementValue.Rows[i][9].ToString() + "','"
-                        + ls_ElementValue.Rows[i][10].ToString() + "')";
+                           + ls_ElementValue.Rows[i][10].ToString() + "','"
+                           + ls_ElementValue.Rows[i][11].ToString() + "','"
+                           + ls_ElementValue.Rows[i][12].ToString() + "','"
+                           + ls_ElementValue.Rows[i][13].ToString() + "','"
+                           + ls_ElementValue.Rows[i][14].ToString() + "','"
+                           + ls_ElementValue.Rows[i][15].ToString() + "','"
+                        + ls_ElementValue.Rows[i][16].ToString() + "')";
                     int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
                 }
 
@@ -2132,5 +2127,379 @@ namespace OTSIncAReportApp
 
         #endregion
 
+        private void button7_Click(object sender, EventArgs e)
+        {
+            //为防止重复打开报告后,显示数据库占用错误,先确保报告模板进程已关闭
+            Process[] processes = Process.GetProcesses();
+            foreach (Process proc in processes)
+            {
+                if (proc.ProcessName == "OTSIncAReportTemplate")
+                {
+                    DialogResult dr = MessageBox.Show("报告模板已打开,请先关闭!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                    if (dr == DialogResult.OK)
+                    {
+                        return;
+                    }
+                }
+            }
+
+            if (File.Exists(m_strDBpathGB))
+            {
+                DialogResult dr = MessageBox.Show("[Yes]直接打开报表,[No]重新生成报表,[Cancal]取消操作", "报表已有生成数据,请选择操作", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
+
+                if (dr == DialogResult.Yes)
+                {
+                    
+                    OpenOTSINcAreportGBTemplateAPP();
+                    return;
+                }
+                if (dr == DialogResult.No)
+                {
+                    //GoTo Here;
+                    //不干预,跳转到下面执行导出操作
+                }
+                if (dr == DialogResult.Cancel)
+                {
+                    //取消,返回
+                    return;
+                }
+            }
+            //通过底层CLR运算,获取国标参数信息
+            string resultfile = m_ReportApp.resultFilesList[m_ReportApp.WorkingResult].FilePath + "\\"
+                                + m_ReportApp.resultFilesList[m_ReportApp.WorkingResult].FileName;
+            m_ReportApp.m_DataMgrFun.m_ReportMgr.AddASmplMsrResultMgr(resultfile);
+            OTSCLRINTERFACE.CPropParamClr clr_prop = m_ReportApp.m_DataMgrFun.m_ReportMgr.GetPropertyParamTable();
+            List<DataTable> GB1 = m_export_reporttemplate.InsertReportTemplateTable_ChineseStandardABCDDS(clr_prop);
+            List<DataTable> GB2 = m_export_reporttemplate.InsertReportTemplateTable_NationalStandardMethodTwo(clr_prop);
+            DataTable ResultGrid = m_export_reporttemplate.InsertReportTemplateTable_ResultGrid();
+            SaveReportGBTemplateDBFile(GB1, GB2, ResultGrid);//将国标信息存储到数据库中
+            OpenOTSINcAreportGBTemplateAPP();//打开报告模板程序
+
+        }
+        /// <summary>
+        /// 将国标数据保存至DB数据中
+        /// </summary>
+        private void SaveReportGBTemplateDBFile(List<DataTable> GB1, List<DataTable> GB2, DataTable ResultGrid)
+        {
+            File.Delete(m_strDBpathGB);//测试时删除数据库文件,为防止第二次打开报告提示数据库占用,挪到方法开始处
+            SqlHelper.CreateNewDatabase(m_strDBpathGB);
+            SqlHelper sh = new SqlHelper("data source='" + m_strDBpathGB + "'");
+
+            //开始事务
+            SQLiteTransaction tr = sh.BeginTranscation();
+            try
+            {
+                //创建表 ResultGrid
+                string[] strcolumns_ResultGrid = { "CLJGMC", "YXSJ", "SCZS", "FLFA", "YJCTZ", "SCMJ", "CKBZ" };
+                string[] strcoltypes_ResultGrid = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
+                sh.CreateTable("ResultGrid", strcolumns_ResultGrid, strcoltypes_ResultGrid);
+
+                //创建表 GB1_A
+                string[] strcolumns_GB1_A = { "Class", "Width", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "c10", "c11" };
+                string[] strcoltypes_GB1_A = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
+                sh.CreateTable("GB1_A", strcolumns_GB1_A, strcoltypes_GB1_A);
+
+                //创建表 GB1_B
+                string[] strcolumns_GB1_B = { "Class", "Width", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "c10", "c11" };
+                string[] strcoltypes_GB1_B = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
+                sh.CreateTable("GB1_B", strcolumns_GB1_B, strcoltypes_GB1_B);
+
+                //创建表 GB1_C
+                string[] strcolumns_GB1_C = { "Class", "Width", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "c10", "c11" };
+                string[] strcoltypes_GB1_C = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
+                sh.CreateTable("GB1_C", strcolumns_GB1_C, strcoltypes_GB1_C);
+
+                //创建表 GB1_D
+                string[] strcolumns_GB1_D = { "Class", "Width", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "c10", "c11" };
+                string[] strcoltypes_GB1_D = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
+                sh.CreateTable("GB1_D", strcolumns_GB1_D, strcoltypes_GB1_D);
+
+                //创建表 GB1_DS
+                string[] strcolumns_GB1_DS = { "No", "Area", "MaxFeret", "X", "Y", "Grade" };
+                string[] strcoltypes_GB1_DS = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
+                sh.CreateTable("GB1_DS", strcolumns_GB1_DS, strcoltypes_GB1_DS);
+
+
+                //创建表 GB2_A
+                string[] strcolumns_GB2_A = { "Class", "Width", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "c10", "c11" };
+                string[] strcoltypes_GB2_A = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
+                sh.CreateTable("GB2_A", strcolumns_GB2_A, strcoltypes_GB2_A);
+
+                //创建表 GB2_B
+                string[] strcolumns_GB2_B = { "Class", "Width", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "c10", "c11" };
+                string[] strcoltypes_GB2_B = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
+                sh.CreateTable("GB2_B", strcolumns_GB2_B, strcoltypes_GB2_B);
+
+                //创建表 GB2_C
+                string[] strcolumns_GB2_C = { "Class", "Width", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "c10", "c11" };
+                string[] strcoltypes_GB2_C = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
+                sh.CreateTable("GB2_C", strcolumns_GB2_C, strcoltypes_GB2_C);
+
+                //创建表 GB2_D
+                string[] strcolumns_GB2_D = { "Class", "Width", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "c10", "c11" };
+                string[] strcoltypes_GB2_D = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
+                sh.CreateTable("GB2_D", strcolumns_GB2_D, strcoltypes_GB2_D);
+
+                //创建表 GB2_D_sulfide
+                string[] strcolumns_GB2_D_sulfide = { "Class", "Width", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "c10", "c11" };
+                string[] strcoltypes_GB2_D_sulfide = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
+                sh.CreateTable("GB2_D_sulfide", strcolumns_GB2_D_sulfide, strcoltypes_GB2_D_sulfide);
+
+                //创建表 GB2_DS
+                string[] strcolumns_GB2_DS = { "No", "Area", "MaxFeret", "X", "Y", "Grade" };
+                string[] strcoltypes_GB2_DS = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
+                sh.CreateTable("GB2_DS", strcolumns_GB2_DS, strcoltypes_GB2_DS);
+
+
+                for (int i = 0; i < ResultGrid.Rows.Count; i++)
+                {
+                    string ls_sqlstr = "insert into ResultGrid (CLJGMC, YXSJ, SCZS, FLFA, YJCTZ, SCMJ, CKBZ) values('"
+                        + ResultGrid.Rows[i][0].ToString() + "','"
+                        + ResultGrid.Rows[i][1].ToString() + "','"
+                        + ResultGrid.Rows[i][2].ToString() + "','"
+                        + ResultGrid.Rows[i][3].ToString() + "','"
+                        + ResultGrid.Rows[i][4].ToString() + "','"
+                        + ResultGrid.Rows[i][5].ToString() + "','"
+                        + ResultGrid.Rows[i][6].ToString() + "')";
+                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
+                }
+
+
+                //插入 GB1_A
+                for (int i = 0; i < GB1[0].Rows.Count; i++)
+                {
+                    string ls_sqlstr = "insert into GB1_A (Class, Width, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11 ) values('"
+                        + GB1[0].Rows[i][0].ToString() + "','"
+                        + GB1[0].Rows[i][1].ToString() + "','"
+                        + GB1[0].Rows[i][2].ToString() + "','"
+                        + GB1[0].Rows[i][3].ToString() + "','"
+                        + GB1[0].Rows[i][4].ToString() + "','"
+                        + GB1[0].Rows[i][5].ToString() + "','"
+                        + GB1[0].Rows[i][6].ToString() + "','"
+                        + GB1[0].Rows[i][7].ToString() + "','"
+                        + GB1[0].Rows[i][8].ToString() + "','"
+                        + GB1[0].Rows[i][9].ToString() + "','"
+                        + GB1[0].Rows[i][10].ToString() + "','"
+                        + GB1[0].Rows[i][11].ToString() + "','"
+                        + GB1[0].Rows[i][12].ToString() + "')";
+                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
+                }
+                //插入 GB1_B
+                for (int i = 0; i < GB1[1].Rows.Count; i++)
+                {
+                    string ls_sqlstr = "insert into GB1_B (Class, Width, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11 ) values('"
+                        + GB1[1].Rows[i][0].ToString() + "','"
+                        + GB1[1].Rows[i][1].ToString() + "','"
+                        + GB1[1].Rows[i][2].ToString() + "','"
+                        + GB1[1].Rows[i][3].ToString() + "','"
+                        + GB1[1].Rows[i][4].ToString() + "','"
+                        + GB1[1].Rows[i][5].ToString() + "','"
+                        + GB1[1].Rows[i][6].ToString() + "','"
+                        + GB1[1].Rows[i][7].ToString() + "','"
+                        + GB1[1].Rows[i][8].ToString() + "','"
+                        + GB1[1].Rows[i][9].ToString() + "','"
+                        + GB1[1].Rows[i][10].ToString() + "','"
+                        + GB1[1].Rows[i][11].ToString() + "','"
+                        + GB1[1].Rows[i][12].ToString() + "')";
+                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
+                }
+                //插入 GB1_C
+                for (int i = 0; i < GB1[2].Rows.Count; i++)
+                {
+                    string ls_sqlstr = "insert into GB1_C (Class, Width, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11 ) values('"
+                        + GB1[2].Rows[i][0].ToString() + "','"
+                        + GB1[2].Rows[i][1].ToString() + "','"
+                        + GB1[2].Rows[i][2].ToString() + "','"
+                        + GB1[2].Rows[i][3].ToString() + "','"
+                        + GB1[2].Rows[i][4].ToString() + "','"
+                        + GB1[2].Rows[i][5].ToString() + "','"
+                        + GB1[2].Rows[i][6].ToString() + "','"
+                        + GB1[2].Rows[i][7].ToString() + "','"
+                        + GB1[2].Rows[i][8].ToString() + "','"
+                        + GB1[2].Rows[i][9].ToString() + "','"
+                        + GB1[2].Rows[i][10].ToString() + "','"
+                        + GB1[2].Rows[i][11].ToString() + "','"
+                        + GB1[2].Rows[i][12].ToString() + "')";
+                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
+                }
+                //插入 GB1_D
+                for (int i = 0; i < GB1[3].Rows.Count; i++)
+                {
+                    string ls_sqlstr = "insert into GB1_D (Class, Width, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11 ) values('"
+                        + GB1[3].Rows[i][0].ToString() + "','"
+                        + GB1[3].Rows[i][1].ToString() + "','"
+                        + GB1[3].Rows[i][2].ToString() + "','"
+                        + GB1[3].Rows[i][3].ToString() + "','"
+                        + GB1[3].Rows[i][4].ToString() + "','"
+                        + GB1[3].Rows[i][5].ToString() + "','"
+                        + GB1[3].Rows[i][6].ToString() + "','"
+                        + GB1[3].Rows[i][7].ToString() + "','"
+                        + GB1[3].Rows[i][8].ToString() + "','"
+                        + GB1[3].Rows[i][9].ToString() + "','"
+                        + GB1[3].Rows[i][10].ToString() + "','"
+                        + GB1[3].Rows[i][11].ToString() + "','"
+                        + GB1[3].Rows[i][12].ToString() + "')";
+                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
+                }
+                //插入 GB1_DS
+                for (int i = 0; i < GB1[4].Rows.Count; i++)
+                {
+                    string ls_sqlstr = "insert into GB1_DS (No, Area, MaxFeret, X, Y, Grade ) values('"
+                        + GB1[4].Rows[i][0].ToString() + "','"
+                        + GB1[4].Rows[i][1].ToString() + "','"
+                        + GB1[4].Rows[i][2].ToString() + "','"
+                        + GB1[4].Rows[i][3].ToString() + "','"
+                        + GB1[4].Rows[i][4].ToString() + "','"
+                        + GB1[4].Rows[i][5].ToString() + "')";
+                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
+                }
+
+
+
+
+                //插入 GB2_A
+                for (int i = 0; i < GB2[0].Rows.Count; i++)
+                {
+                    string ls_sqlstr = "insert into GB2_A (Class, Width, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11 ) values('"
+                        + GB2[0].Rows[i][0].ToString() + "','"
+                        + GB2[0].Rows[i][1].ToString() + "','"
+                        + GB2[0].Rows[i][2].ToString() + "','"
+                        + GB2[0].Rows[i][3].ToString() + "','"
+                        + GB2[0].Rows[i][4].ToString() + "','"
+                        + GB2[0].Rows[i][5].ToString() + "','"
+                        + GB2[0].Rows[i][6].ToString() + "','"
+                        + GB2[0].Rows[i][7].ToString() + "','"
+                        + GB2[0].Rows[i][8].ToString() + "','"
+                        + GB2[0].Rows[i][9].ToString() + "','"
+                        + GB2[0].Rows[i][10].ToString() + "','"
+                        + GB2[0].Rows[i][11].ToString() + "','"
+                        + GB2[0].Rows[i][12].ToString() + "')";
+                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
+                }
+                //插入 GB2_B
+                for (int i = 0; i < GB2[1].Rows.Count; i++)
+                {
+                    string ls_sqlstr = "insert into GB2_B (Class, Width, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11 ) values('"
+                        + GB2[1].Rows[i][0].ToString() + "','"
+                        + GB2[1].Rows[i][1].ToString() + "','"
+                        + GB2[1].Rows[i][2].ToString() + "','"
+                        + GB2[1].Rows[i][3].ToString() + "','"
+                        + GB2[1].Rows[i][4].ToString() + "','"
+                        + GB2[1].Rows[i][5].ToString() + "','"
+                        + GB2[1].Rows[i][6].ToString() + "','"
+                        + GB2[1].Rows[i][7].ToString() + "','"
+                        + GB2[1].Rows[i][8].ToString() + "','"
+                        + GB2[1].Rows[i][9].ToString() + "','"
+                        + GB2[1].Rows[i][10].ToString() + "','"
+                        + GB2[1].Rows[i][11].ToString() + "','"
+                        + GB2[1].Rows[i][12].ToString() + "')";
+                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
+                }
+                //插入 GB2_C
+                for (int i = 0; i < GB2[2].Rows.Count; i++)
+                {
+                    string ls_sqlstr = "insert into GB2_C (Class, Width, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11 ) values('"
+                        + GB2[2].Rows[i][0].ToString() + "','"
+                        + GB2[2].Rows[i][1].ToString() + "','"
+                        + GB2[2].Rows[i][2].ToString() + "','"
+                        + GB2[2].Rows[i][3].ToString() + "','"
+                        + GB2[2].Rows[i][4].ToString() + "','"
+                        + GB2[2].Rows[i][5].ToString() + "','"
+                        + GB2[2].Rows[i][6].ToString() + "','"
+                        + GB2[2].Rows[i][7].ToString() + "','"
+                        + GB2[2].Rows[i][8].ToString() + "','"
+                        + GB2[2].Rows[i][9].ToString() + "','"
+                        + GB2[2].Rows[i][10].ToString() + "','"
+                        + GB2[2].Rows[i][11].ToString() + "','"
+                        + GB2[2].Rows[i][12].ToString() + "')";
+                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
+                }
+                //插入 GB1_D
+                for (int i = 0; i < GB2[3].Rows.Count; i++)
+                {
+                    string ls_sqlstr = "insert into GB2_D (Class, Width, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11 ) values('"
+                        + GB2[3].Rows[i][0].ToString() + "','"
+                        + GB2[3].Rows[i][1].ToString() + "','"
+                        + GB2[3].Rows[i][2].ToString() + "','"
+                        + GB2[3].Rows[i][3].ToString() + "','"
+                        + GB2[3].Rows[i][4].ToString() + "','"
+                        + GB2[3].Rows[i][5].ToString() + "','"
+                        + GB2[3].Rows[i][6].ToString() + "','"
+                        + GB2[3].Rows[i][7].ToString() + "','"
+                        + GB2[3].Rows[i][8].ToString() + "','"
+                        + GB2[3].Rows[i][9].ToString() + "','"
+                        + GB2[3].Rows[i][10].ToString() + "','"
+                        + GB2[3].Rows[i][11].ToString() + "','"
+                        + GB2[3].Rows[i][12].ToString() + "')";
+                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
+                }
+                //插入 GB2_D_sulfide
+                for (int i = 0; i < GB2[4].Rows.Count; i++)
+                {
+                    string ls_sqlstr = "insert into GB2_D_sulfide (Class, Width, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11 ) values('"
+                        + GB2[4].Rows[i][0].ToString() + "','"
+                        + GB2[4].Rows[i][1].ToString() + "','"
+                        + GB2[4].Rows[i][2].ToString() + "','"
+                        + GB2[4].Rows[i][3].ToString() + "','"
+                        + GB2[4].Rows[i][4].ToString() + "','"
+                        + GB2[4].Rows[i][5].ToString() + "','"
+                        + GB2[4].Rows[i][6].ToString() + "','"
+                        + GB2[4].Rows[i][7].ToString() + "','"
+                        + GB2[4].Rows[i][8].ToString() + "','"
+                        + GB2[4].Rows[i][9].ToString() + "','"
+                        + GB2[4].Rows[i][10].ToString() + "','"
+                        + GB2[4].Rows[i][11].ToString() + "','"
+                        + GB2[4].Rows[i][12].ToString() + "')";
+                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
+                }
+                //插入 GB1_DS
+                for (int i = 0; i < GB2[5].Rows.Count; i++)
+                {
+                    string ls_sqlstr = "insert into GB2_DS (No, Area, MaxFeret, X, Y, Grade ) values('"
+                        + GB1[5].Rows[i][0].ToString() + "','"
+                        + GB1[5].Rows[i][1].ToString() + "','"
+                        + GB1[5].Rows[i][2].ToString() + "','"
+                        + GB1[5].Rows[i][3].ToString() + "','"
+                        + GB1[5].Rows[i][4].ToString() + "','"
+                        + GB1[5].Rows[i][5].ToString() + "')";
+                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
+                }
+
+                //事务提交
+                sh.TranscationCommit(tr);
+
+            }
+            catch (Exception ee)
+            {
+                //回滚
+                sh.TranscationRollback(tr);
+            }
+            finally
+            {
+                //最后关闭连接
+                tr.Dispose();
+                tr = null;
+                sh.CloseConnection();
+            }
+        }
+        /// <summary>
+        /// 打开国标导出
+        /// </summary>
+        private void OpenOTSINcAreportGBTemplateAPP()
+        {
+            ProcessStartInfo process = new ProcessStartInfo();
+            process.FileName = "ReportTemplateExe\\OTSIncAReportTemplate.exe";//打开app的路径
+            string arg1 = m_strDBpathGB.Replace(" ", "^");//参数1,是需要打开db数据库的路径
+            string arg2 = tb_mblj.Text.Trim().Replace(" ", "^");//参数2,是模板文件的路径
+            string arg3 = "GBReport";//主体报表
+            string arg4 = "100";//夹杂物数量
+            string arg5 = "0-100";//打开的标记帧图图像数量
+            process.Arguments = string.Format("{0} {1} {2} {3} {4}", arg1, arg2, arg3, arg4, arg5);  //多个参数用空格隔开
+            process.WindowStyle = ProcessWindowStyle.Normal;
+            Process.Start(process);
+        }
+
+      
     }
+    
 }

+ 0 - 3
OTSIncAReportApp/OTSTemplateDesigner/OTSReport_Export.resx

@@ -120,9 +120,6 @@
   <metadata name="backgroundWorker2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>273, 19</value>
   </metadata>
-  <metadata name="rmReport1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>681, 17</value>
-  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>

+ 4 - 1
OTSIncAReportApp/frmReportApp.cs

@@ -22,6 +22,7 @@ namespace OTSIncAReportApp
     /// </summary>
     public partial class frmReportApp : Form
     {
+        
 
         #region 共享窗体对象--------------------------------------------------------------------------------------
         public frmMeasureRstMgr m_RstWindow = null;                             //测量结果,树控件窗体,属性Grid窗体
@@ -318,12 +319,14 @@ namespace OTSIncAReportApp
             }
 
 
+            
+
         }
 
         #endregion
 
         #region Ribbon菜单按钮及菜单相关按按钮事件
-      
+
         /// <summary>
         /// 新建按钮事件
         /// </summary>

+ 103 - 3
OTSIncAReportTemplate/OTSIncAReportTemplate.cs

@@ -61,7 +61,7 @@ namespace OTSIncAReportTemplate
             //}
 
             //方便测试代码分岐
-            bool bDebug = true;
+            bool bDebug = false;
             if (bDebug == false)
             {
                 m_arg1 = args[0].Replace("^", " ");
@@ -85,9 +85,9 @@ namespace OTSIncAReportTemplate
                 //m_arg4 = "0-983";
                 //m_arg5 = "";
 
-                m_arg1 = "C:\\Users\\admin\\Desktop\\ots\\ots\\1\\Sample1\\ReportTemplateDB.db";
+                m_arg1 = "C:\\Users\\admin\\Desktop\\OTS测量结果\\北京测试\\20211110\\1110上\\3#-2\\Sample1\\ReportGBDB.db";
                 m_arg2 = "./Config/ProData/ReportTemplateConfig.xml";
-                m_arg3 = "MainReport";
+                m_arg3 = "GBReport";
                 m_arg4 = "100";
                 m_arg5 = "0-100";
             }
@@ -139,7 +139,13 @@ namespace OTSIncAReportTemplate
                     LoadReportTemplateDBFile_ParticleList();
                     ReportTemplatePrint_PartilceListReport();
                 }
+                else if( m_arg3 == "GBReport")
+                {
+                    LoadReportGBDBFile();
+                    ReportTemplatePrint_GBReport();
+                }
             }
+            
 
             //关闭查看报告,则退出进程
             this.Close();
@@ -502,6 +508,51 @@ namespace OTSIncAReportTemplate
 
         }
 
+        private void ReportTemplatePrint_GBReport()
+        {
+            rmReport1.PreviewOptions.BtnDesignVisible = true;
+            rmReport1.LoadFromFile("Resources\\ReportTemplate\\GB.rmf");
+            DataTable ls_dt_GB1_A = list_dt.Where(aa => aa.TableName.Contains("GB1_A")).ToList()[0];
+            DataTable ls_dt_GB1_B = list_dt.Where(aa => aa.TableName.Contains("GB1_B")).ToList()[0];
+            DataTable ls_dt_GB1_C = list_dt.Where(aa => aa.TableName.Contains("GB1_C")).ToList()[0];
+            DataTable ls_dt_GB1_D = list_dt.Where(aa => aa.TableName.Contains("GB1_D")).ToList()[0];
+            DataTable ls_dt_GB1_DS = list_dt.Where(aa => aa.TableName.Contains("GB1_DS")).ToList()[0];
+
+            DataTable ls_dt_GB2_A = list_dt.Where(aa => aa.TableName.Contains("GB2_A")).ToList()[0];
+            DataTable ls_dt_GB2_B = list_dt.Where(aa => aa.TableName.Contains("GB2_B")).ToList()[0];
+            DataTable ls_dt_GB2_C = list_dt.Where(aa => aa.TableName.Contains("GB2_C")).ToList()[0];
+            DataTable ls_dt_GB2_D = list_dt.Where(aa => aa.TableName.Contains("GB2_D")).ToList()[0];
+            DataTable ls_dt_GB2_D_sulfide = list_dt.Where(aa => aa.TableName.Contains("GB2_D_sulfide")).ToList()[0];
+            DataTable ls_dt_GB2_DS = list_dt.Where(aa => aa.TableName.Contains("GB2_DS")).ToList()[0];
+
+            DataTable ls_resultgrid = list_dt.Where(aa => aa.TableName.Contains("ResultGrid")).ToList()[0];//插入测量结果Grid表格
+
+
+            rmReport1.AddDataSet(ls_dt_GB1_A, "GB1_A");
+            rmReport1.AddDataSet(ls_dt_GB1_B, "GB1_B");
+            rmReport1.AddDataSet(ls_dt_GB1_C, "GB1_C");
+            rmReport1.AddDataSet(ls_dt_GB1_D, "GB1_D");
+            rmReport1.AddDataSet(ls_dt_GB1_DS, "GB1_DS");
+
+            rmReport1.AddDataSet(ls_dt_GB2_A, "GB2_A");
+            rmReport1.AddDataSet(ls_dt_GB2_B, "GB2_B");
+            rmReport1.AddDataSet(ls_dt_GB2_C, "GB2_C");
+            rmReport1.AddDataSet(ls_dt_GB2_D, "GB2_D");
+            rmReport1.AddDataSet(ls_dt_GB2_D_sulfide, "GB2_D_sulfide");
+            rmReport1.AddDataSet(ls_dt_GB2_DS, "GB2_DS");
+
+
+            rmReport1.AddDataSet(ls_resultgrid, "ResultGrid");
+
+            rmReport1.ShowReport();
+            //修复reportmachine的bug,将路径重新定位到当前路径
+            Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
+            rmReport1.Dispose();
+
+            //回收内存
+            list_dt.Clear();
+        }
+
         /// <summary>
         /// 调用预览查看报表,显示颗粒列表
         /// </summary>
@@ -909,6 +960,55 @@ namespace OTSIncAReportTemplate
             ls_Largest3.TableName = "Largest3";
             list_dt.Add(ls_Largest3);
         }
+        /// <summary>
+        /// 读取DB数据库文件,国标部分
+        /// </summary>
+        private void LoadReportGBDBFile()
+        {
+            string strpath = m_arg1;//db数据库路径
+            SqLiteHelper sh = new SqLiteHelper("data source='" + strpath + "'");
+
+            list_dt.Clear();
+
+            DataTable ls_ResultGrid = sh.ExecuteQuery("select * from ResultGrid");
+            ls_ResultGrid.TableName = "ResultGrid";
+            list_dt.Add(ls_ResultGrid);
+
+            DataTable ls_GB1_A = sh.ExecuteQuery("select * from GB1_A");
+            ls_GB1_A.TableName = "GB1_A";
+            list_dt.Add(ls_GB1_A);
+            DataTable ls_GB1_B = sh.ExecuteQuery("select * from GB1_B");
+            ls_GB1_B.TableName = "GB1_B";
+            list_dt.Add(ls_GB1_B);
+            DataTable ls_GB1_C = sh.ExecuteQuery("select * from GB1_C");
+            ls_GB1_C.TableName = "GB1_C";
+            list_dt.Add(ls_GB1_C);
+            DataTable ls_GB1_D = sh.ExecuteQuery("select * from GB1_D");
+            ls_GB1_D.TableName = "GB1_D";
+            list_dt.Add(ls_GB1_D);
+            DataTable ls_GB1_DS = sh.ExecuteQuery("select * from GB1_DS");
+            ls_GB1_DS.TableName = "GB1_DS";
+            list_dt.Add(ls_GB1_DS);
+
+            DataTable ls_GB2_A = sh.ExecuteQuery("select * from GB2_A");
+            ls_GB2_A.TableName = "GB2_A";
+            list_dt.Add(ls_GB2_A);
+            DataTable ls_GB2_B = sh.ExecuteQuery("select * from GB2_B");
+            ls_GB2_B.TableName = "GB2_B";
+            list_dt.Add(ls_GB2_B);
+            DataTable ls_GB2_C = sh.ExecuteQuery("select * from GB2_C");
+            ls_GB2_C.TableName = "GB2_C";
+            list_dt.Add(ls_GB2_C);
+            DataTable ls_GB2_D = sh.ExecuteQuery("select * from GB2_D");
+            ls_GB2_D.TableName = "GB2_D";
+            list_dt.Add(ls_GB2_D);
+            DataTable ls_GB2_D_sulfide = sh.ExecuteQuery("select * from GB2_D_sulfide");
+            ls_GB2_D_sulfide.TableName = "GB2_D_sulfide";
+            list_dt.Add(ls_GB2_D_sulfide);
+            DataTable ls_GB2_DS = sh.ExecuteQuery("select * from GB2_DS");
+            ls_GB2_DS.TableName = "GB2_DS";
+            list_dt.Add(ls_GB2_DS);
+        }
         #endregion
 
         #region 回收内存