瀏覽代碼

报告导出bug修复

zhangjiaxin 1 年之前
父節點
當前提交
7bfdbb28e2

+ 18 - 14
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/ElementalAnalysis.cs

@@ -194,24 +194,28 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                 if (!bl)
                 {
                     DataTable dta = m_bt_DBData.Clone();
-                    dta.Rows.Add(m_bt_DBData.Rows[0].ItemArray);
-                    for (int b = 0; b < dta.Columns.Count; b++)
+                    if (m_bt_DBData.Rows.Count!=0)
                     {
-                        if (dta.Columns[b].ColumnName == "TypeName")
+                        dta.Rows.Add(m_bt_DBData.Rows[0].ItemArray);
+                        for (int b = 0; b < dta.Columns.Count; b++)
                         {
-                            dta.Rows[0][b] = m_mbszclass.list_str_MainPriority[i];
-                        }
-                        else if (dta.Columns[b].ColumnName == "Class")
-                        {
-                            dta.Rows[0][b] = "Default";
-                        }
-                        else
-                        {
-                            dta.Rows[0][b] = 0;
+                            if (dta.Columns[b].ColumnName == "TypeName")
+                            {
+                                dta.Rows[0][b] = m_mbszclass.list_str_MainPriority[i];
+                            }
+                            else if (dta.Columns[b].ColumnName == "Class")
+                            {
+                                dta.Rows[0][b] = "Default";
+                            }
+                            else
+                            {
+                                dta.Rows[0][b] = 0;
+                            }
                         }
-                    }
 
-                    datass.Rows.Add(dta.Rows[0].ItemArray);
+                        datass.Rows.Add(dta.Rows[0].ItemArray);
+                    }
+                
                 }
             }
             return datass;

+ 18 - 13
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/ParticleAnalysis.cs

@@ -1124,24 +1124,29 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                 if(!bl)
                 {
                     DataTable dta= m_bt_DBData.Clone();
-                    dta.Rows.Add(m_bt_DBData.Rows[0].ItemArray);
-                    for (int b=0;b< dta.Columns.Count;b++)
+                    if (m_bt_DBData.Rows.Count != 0)
                     {
-                        if(dta.Columns[b].ColumnName== "TypeName")
+                        dta.Rows.Add(m_bt_DBData.Rows[0].ItemArray);
+                        for (int b = 0; b < dta.Columns.Count; b++)
                         {
-                            dta.Rows[0][b]= m_mbszclass.list_str_MainPriority[i];
-                        }
-                        else if (dta.Columns[b].ColumnName == "Class")
-                        {
-                            dta.Rows[0][b] = "Default";
-                        }
-                        else
-                        {
-                            dta.Rows[0][b] = 0;
+                            if (dta.Columns[b].ColumnName == "TypeName")
+                            {
+                                dta.Rows[0][b] = m_mbszclass.list_str_MainPriority[i];
+                            }
+                            else if (dta.Columns[b].ColumnName == "Class")
+                            {
+                                dta.Rows[0][b] = "Default";
+                            }
+                            else
+                            {
+                                dta.Rows[0][b] = 0;
+                            }
                         }
+
+                        datass.Rows.Add(dta.Rows[0].ItemArray);
                     }
 
-                    datass.Rows.Add(dta.Rows[0].ItemArray);
+                    
                 }
             }
 

+ 1 - 1
OTSIncAReportApp/1-UI/OTSReportExport/OTSReport_Export.cs

@@ -596,7 +596,7 @@ namespace OTSIncAReportApp
         {
             m_ReportApp.m_rstDataMgr.setSelectedIndex(cbo_sjy.SelectedIndex);
 
-            DEVReport = new OTS_DEVReport(this, m_mbszclass, m_ReportApp);
+            DEVReport = new OTS_DEVReport(this, m_mbszclass, m_ReportApp, table);
             LoadData();
             ReportPrintTool tool = new ReportPrintTool(DEVReport);
             tool.ShowPreview();

+ 5 - 2
OTSIncAReportApp/1-UI/OTSReportExport/Template/DataTemplate.cs

@@ -9,6 +9,7 @@ using OTSIncAReportApp.OTSSampleReportInfo;
 using OTSIncAReportApp.OTSTemplateDesigner;
 using OTSIncAReportGrids;
 using System;
+using System.Collections;
 using System.Collections.Generic;
 using System.Data;
 using System.Drawing;
@@ -34,7 +35,9 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
         private string ComputeModeName = "";//计算方式
         private string PartSizeFile = "";//粒级文件
 
-        public OTS_DEVReport(OTSReport_Export in_export, c_TemplateClass a_Template, frmReportApp a_frmReportApp)
+
+        System.Collections.Hashtable table;
+        public OTS_DEVReport(OTSReport_Export in_export, c_TemplateClass a_Template, frmReportApp a_frmReportApp , Hashtable a_table)
         {
             TemplateClass = a_Template;
             m_otsreport_export = in_export;
@@ -140,7 +143,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             setXRLabelData(dev_flfa, GetlanguageData(dev_flfa.Name.ToString(), languageData, dev_flfa.Text));//表中分类方案
             setXRLabelData(dev_ckbz, GetlanguageData(dev_ckbz.Name.ToString(), languageData, dev_ckbz.Text));//表中参考标准
             setXRLabelData(dev_yjctz, GetlanguageData(dev_yjctz.Name.ToString(), languageData, dev_yjctz.Text));//表中已检测特征
-            setXRLabelData(dev_scmj, GetlanguageData(dev_scmj.Name.ToString(), languageData, dev_scmj.Text));//表中视场面积
+            setXRLabelData(dev_scmj, GetlanguageData(dev_scmj.Name.ToString(), languageData, dev_scmj.Text));//表中视场面积  总检测面积
             setXRLabelData(dev_bgsj, GetlanguageData(dev_bgsj.Name.ToString(), languageData, dev_bgsj.Text));//表中报告时间
             setXRLabelData(dev_fdbs, GetlanguageData(dev_fdbs.Name.ToString(), languageData, dev_fdbs.Text));//表中放大倍数
             //颗粒列表图