Sfoglia il codice sorgente

增加国标导出选择功能

zhangjiaxin 3 anni fa
parent
commit
63dc58c94f

+ 54 - 0
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -15,6 +15,8 @@ using System.Linq;
 using System.Windows.Forms;
 using System.Xml;
 using static OTSIncAReportApp.OTSReport_Export;
+using OTSIncAReportApp.ReportTemplate;
+using OTSIncAReportApp.OTSSampleReportInfo;
 
 namespace OTSIncAReportApp.OTSTemplateDesigner
 {
@@ -2058,6 +2060,58 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             }
             return AreaRatio_dt;
         }
+
+
+
+
+
+        public void criterion_out(GBReport GB_Report, OTSReport_Export in_export,int Index,DataTable dev_internationalLanguage,bool gb_1,bool gb_2,bool AmericanStandard,bool GermanStandard)
+        {
+            //首页信息
+            GB_Report = new GBReport(in_export);
+            GB_Report.setResultGrid(m_otsreport_export.m_mbszclass);
+            GB_Report.International_language(dev_internationalLanguage);
+
+
+            for (int i = 0; i < m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList.Count; i++)
+            {
+                string anothername = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName.ToString();
+                string resultfile = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[i].FilePath.ToString() + "\\" + m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[i].FileName_real.ToString();
+                m_otsreport_export.m_ReportApp.m_rstDataMgr.m_ReportMgr.AddASmplMsrResultMgr(resultfile, anothername);
+            }
+            OTSCLRINTERFACE.CPropParamClr clr_prop = m_otsreport_export.m_ReportApp.m_rstDataMgr.m_ReportMgr.GetPropertyParamTable();
+            List<string> datasourcelist = m_otsreport_export.m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
+
+            if (gb_1)
+            {
+                List<DataTable> GB1 = InsertReportTemplateTable_ChineseStandardABCDDS(clr_prop, datasourcelist, Index, (int)CALCULATE_TABLE_TYPE.GB_Method1);
+                List<string> GB1NameList = new List<string>();
+                GB1NameList.Add("A类");
+                GB1NameList.Add("B类");
+                GB1NameList.Add("C类");
+                GB1NameList.Add("D类");
+                GB1NameList.Add("DS类");
+                GB_Report.set_GB_Method(GB1, GB1NameList, "方法一");
+            }
+
+            if (gb_2)
+            {
+                List<DataTable> GB2 = InsertReportTemplateTable_ChineseStandardABCDDS(clr_prop, datasourcelist, Index, (int)CALCULATE_TABLE_TYPE.GB_Method2);
+                List<string> GB2NameList = new List<string>();
+                GB2NameList.Add("A类");
+                GB2NameList.Add("B类");
+                GB2NameList.Add("C类");
+                GB2NameList.Add("D类");
+                GB2NameList.Add("D硫化物类");
+                GB2NameList.Add("DS类");
+                GB_Report.set_GB_Method(GB2, GB2NameList, "方法二");
+            }
+
+
+
+            DevExpress.XtraReports.UI.ReportPrintTool tool = new DevExpress.XtraReports.UI.ReportPrintTool(GB_Report);
+            tool.ShowPreview();
+        }
     }
 
 }

+ 42 - 378
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_Export.cs

@@ -1188,43 +1188,43 @@ namespace OTSIncAReportApp
             //DEVReport.Dispose();
           
 
-            //为防止重复打开报告后,显示数据库占用错误,先确保报告模板进程已关闭
-            Process[] processes = Process.GetProcesses();
-            foreach (Process proc in processes)
-            {
-                if (proc.ProcessName == "OTSIncAReportTemplate")
-                {
-                    DialogResult dr = MessageBox.Show(table["messagebox3"].ToString(), table["messagebox4"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                    if (dr == DialogResult.OK)
-                    {
-                        return;
-                    }
-                }
-            }
-            //调用模板设计器,预览
-            //判断该测量结果文件目录中是否已经有数据库文件,有的话,直接打开,没有则进行导出数据库然后再打开
-            if (File.Exists(m_strDBpath))
-            {
-                DialogResult dr = MessageBox.Show(table["messagebox5"].ToString(), table["messagebox6"].ToString(), MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
-
-                if (dr == DialogResult.Yes)
-                {
-                    WriteRictBox(table["messagebox7"].ToString());
-                    //存在则直接打开报表
-                    OpenOTSINcAreportTemplateAPP();
-                    return;
-                }
-                if (dr == DialogResult.No)
-                {
-                    //GoTo Here;
-                    //不干预,跳转到下面执行导出操作
-                }
-                if (dr == DialogResult.Cancel)
-                {
-                    //取消,返回
-                    return;
-                }
-            }
+            ////为防止重复打开报告后,显示数据库占用错误,先确保报告模板进程已关闭
+            //Process[] processes = Process.GetProcesses();
+            //foreach (Process proc in processes)
+            //{
+            //    if (proc.ProcessName == "OTSIncAReportTemplate")
+            //    {
+            //        DialogResult dr = MessageBox.Show(table["messagebox3"].ToString(), table["messagebox4"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Warning);
+            //        if (dr == DialogResult.OK)
+            //        {
+            //            return;
+            //        }
+            //    }
+            //}
+            ////调用模板设计器,预览
+            ////判断该测量结果文件目录中是否已经有数据库文件,有的话,直接打开,没有则进行导出数据库然后再打开
+            //if (File.Exists(m_strDBpath))
+            //{
+            //    DialogResult dr = MessageBox.Show(table["messagebox5"].ToString(), table["messagebox6"].ToString(), MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
+
+            //    if (dr == DialogResult.Yes)
+            //    {
+            //        WriteRictBox(table["messagebox7"].ToString());
+            //        //存在则直接打开报表
+            //        OpenOTSINcAreportTemplateAPP();
+            //        return;
+            //    }
+            //    if (dr == DialogResult.No)
+            //    {
+            //        //GoTo Here;
+            //        //不干预,跳转到下面执行导出操作
+            //    }
+            //    if (dr == DialogResult.Cancel)
+            //    {
+            //        //取消,返回
+            //        return;
+            //    }
+            //}
             
             //frmReportConditionChoose frm = new frmReportConditionChoose(m_ReportApp);
             //frm.ShowDataDiagram(DisplayPicutureType.AnalyzeDataChart);
@@ -1768,350 +1768,14 @@ namespace OTSIncAReportApp
         private void button7_Click(object sender, EventArgs e)
         {
 
-            for (int i = 0; i < m_ReportApp.m_rstDataMgr.ResultFilesList.Count; i++)
-            {
-                string anothername = m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName.ToString();
-                string resultfile = m_ReportApp.m_rstDataMgr.ResultFilesList[i].FilePath.ToString() + "\\" + m_ReportApp.m_rstDataMgr.ResultFilesList[i].FileName_real.ToString();
-                m_ReportApp.m_rstDataMgr.m_ReportMgr.AddASmplMsrResultMgr(resultfile, anothername);
-            }
-            OTSCLRINTERFACE.CPropParamClr clr_prop = m_ReportApp.m_rstDataMgr.m_ReportMgr.GetPropertyParamTable();
-            List<string> datasourcelist = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
-            List<DataTable> GB1= m_export_reporttemplate.InsertReportTemplateTable_ChineseStandardABCDDS(clr_prop, datasourcelist, cbo_sjy.SelectedIndex, (int)CALCULATE_TABLE_TYPE.GB_Method1);
-            List<string> GB1NameList = new List<string>();
-            GB1NameList.Add("A类");
-            GB1NameList.Add("B类");
-            GB1NameList.Add("C类");
-            GB1NameList.Add("D类");
-            GB1NameList.Add("DS类");
-            List<DataTable> GB2 = m_export_reporttemplate.InsertReportTemplateTable_ChineseStandardABCDDS(clr_prop, datasourcelist, cbo_sjy.SelectedIndex, (int)CALCULATE_TABLE_TYPE.GB_Method2);
-            List<string> GB2NameList = new List<string>();
-            GB2NameList.Add("A类");
-            GB2NameList.Add("B类");
-            GB2NameList.Add("C类");
-            GB2NameList.Add("D类");
-            GB2NameList.Add("D硫化物类");
-            GB2NameList.Add("DS类");
-            GB_Report = new GBReport(this);
-            GB_Report.setResultGrid(m_mbszclass);
-            GB_Report.International_language(dev_internationalLanguage());
-            GB_Report.set_GB_Method(GB1, GB1NameList,"方法一");
-
-            GB_Report.set_GB_Method(GB2, GB2NameList,"方法二");
-           ReportPrintTool tool = new ReportPrintTool(GB_Report);
-            tool.ShowPreview();
-
+            OTSReport_criterion criterion = new OTSReport_criterion(m_export_reporttemplate, GB_Report,this);
+            criterion.Sample_order = cbo_sjy.SelectedIndex;
+            criterion.Language_dt = dev_internationalLanguage();
+            criterion.ShowDialog();
 
         }
-        /// <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();
-           
-                //创建表 ResultGrid
-                string[] strcolumns_ResultGrid = { "CLJGMC", "YXSJ", "SCZS", "FLFA", "YJCTZ", "SCMJ", "CKBZ", "FDBS" };
-                string[] strcoltypes_ResultGrid = { "TEXT", "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('"
-                        + GB2[5].Rows[i][0].ToString() + "','"
-                        + GB2[5].Rows[i][1].ToString() + "','"
-                        + GB2[5].Rows[i][2].ToString() + "','"
-                        + GB2[5].Rows[i][3].ToString() + "','"
-                        + GB2[5].Rows[i][4].ToString() + "','"
-                        + GB2[5].Rows[i][5].ToString() + "')";
-                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
-                }
-
-                //事务提交
-                sh.TranscationCommit(tr);
-
-                //最后关闭连接
-                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);
-
-            
-        }
+      
        
         private void OTSReport_Export_FormClosed(object sender, FormClosedEventArgs e)
         {

+ 9 - 0
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -448,6 +448,12 @@
     <Compile Include="1-UI\Frm_UserProgress.designer.cs">
       <DependentUpon>Frm_UserProgress.cs</DependentUpon>
     </Compile>
+    <Compile Include="1-UI\OTSTemplateDesigner\OTSReport_criterion.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="1-UI\OTSTemplateDesigner\OTSReport_criterion.Designer.cs">
+      <DependentUpon>OTSReport_criterion.cs</DependentUpon>
+    </Compile>
     <Compile Include="ReportTemplate\GBReport.cs">
       <SubType>Component</SubType>
     </Compile>
@@ -733,6 +739,9 @@
     <EmbeddedResource Include="1-UI\Controls\OTSPeriodicTable\User_Element_Small.resx">
       <DependentUpon>User_Element_Small.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="1-UI\OTSTemplateDesigner\OTSReport_criterion.resx">
+      <DependentUpon>OTSReport_criterion.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="1-UI\OTSTemplateDesigner\OTSReport_Export.resx">
       <DependentUpon>OTSReport_Export.cs</DependentUpon>
     </EmbeddedResource>