Forráskód Böngészése

颗粒列表导出execl添加进度条

cxs 1 éve
szülő
commit
45da106bb6

+ 1 - 11
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -110,7 +110,6 @@ namespace OTSIncAReportGraph.Controls
 
 
         //这里要做成控件,不要是窗体
-        //public List<DisplayParticle> m_list_allDPart = null;
         public List<DisplayParticle> m_list_allDPart_original = null;
         public List<DisplayField> m_CurGBFields = new List<DisplayField>();
 
@@ -139,12 +138,6 @@ namespace OTSIncAReportGraph.Controls
         //提供鼠标在右下角显示的文本,右侧
         private string m_str_mouseshow_right = "";
 
-
-
-
-
-
-
         //当前鼠标的位置
         Point m_mouse_now_point = new Point();
 
@@ -165,7 +158,6 @@ namespace OTSIncAReportGraph.Controls
         private Thread m_mythread;
 
 
-
         private Color m_ColorNotContent = Color.SkyBlue;
 
         //读取背景原图的名称和图片
@@ -770,7 +762,6 @@ namespace OTSIncAReportGraph.Controls
 
                 if (m_SelectTool.IsSelecting)
                 {
-
                     m_SelectTool.StartPoint = e.Location;
                 }
                 else if (m_ParticleSegmentation.IsParticleSegmentation)
@@ -843,10 +834,9 @@ namespace OTSIncAReportGraph.Controls
                     m_ParticleSegmentation.EndPoint = e.Location;
                 }
             }
-
-            
             if (m_SelectTool.IsSelecting)
             {
+
                 if (e.Button == MouseButtons.Left)
                 {
                     if (e.Location.X > m_SelectTool.StartPoint.X && e.Location.Y > m_SelectTool.StartPoint.Y)

+ 18 - 2
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.cs

@@ -1808,6 +1808,13 @@ namespace OTSIncAReportGrids
             if (sfd.ShowDialog() == DialogResult.OK)
             {
                 Cursor = Cursors.WaitCursor;
+
+                //var progr = new Frm_UserProgress();
+                if (m_frm_userprogress.IsDisposed)
+                {
+                    ProgressStart();
+                }
+
                 //IWorkbook workbook = new HSSFWorkbook();   //用于创建.xls  office2003开始以前的
                 IWorkbook workbook = new NPOI.XSSF.UserModel.XSSFWorkbook();        //用于创建.xlsx office2007开始以后的
                 ISheet sheet;
@@ -1855,8 +1862,8 @@ namespace OTSIncAReportGrids
 
                     cell.SetCellValue(dgV_ParticlesDevidePage.Columns[i_cell].HeaderText);
                 }
+                m_frm_userprogress.SetProgressValueAndText(0, "export:"+"0"+"/total:"+ dgV_ParticlesDevidePage.Rows.Count);
 
-               
                 IClientAnchor anchor;
                 int pictureIdx;
                 Bitmap bp;
@@ -1865,6 +1872,11 @@ namespace OTSIncAReportGrids
                 //插入表内容
                 for (int i_row = 0; i_row < dgV_ParticlesDevidePage.Rows.Count; i_row++)
                 {
+                    if (dgV_ParticlesDevidePage.Rows.Count > 100)
+                    {
+                        if (i_row%(dgV_ParticlesDevidePage.Rows.Count / 100) == 0)
+                            m_frm_userprogress.SetProgressValueAndText(i_row / (dgV_ParticlesDevidePage.Rows.Count / 100), "export:" + i_row + "/total:" + dgV_ParticlesDevidePage.Rows.Count);
+                    }
                     row = sheet.CreateRow(2 + i_row);
                     row.Height = 45 * 20;
                     for (int i_cell = 0; i_cell < dgV_ParticlesDevidePage.Columns.Count; i_cell++)
@@ -1994,7 +2006,10 @@ namespace OTSIncAReportGrids
                 workbook.Write(file);
                 file.Close();
 
-                MessageBox.Show("Export complete!");
+                //MessageBox.Show("Export complete!");
+                //m_frm_userprogress.SetProgressValueAndText(100, "export:" + dgV_ParticlesDevidePage.Rows.Count + "/total:" + dgV_ParticlesDevidePage.Rows.Count);
+                //加载完成,关闭进度条
+                m_frm_userprogress.Close();
 
                 Cursor = Cursors.Default;
                 //导出完成后,打开Excel文件
@@ -2006,6 +2021,7 @@ namespace OTSIncAReportGrids
             }
         }
 
+
         void CreateChart(IDrawing drawing, ISheet sheet, IClientAnchor anchor, int rowid)
         {
             var chart = drawing.CreateChart(anchor) as XSSFChart;

+ 0 - 1
OTSIncAReportApp/1-UI/Control_Grids/SpectrumExportConfirmation.cs

@@ -107,7 +107,6 @@ namespace OTSIncAReportApp._1_UI.Control_Grids
             {
                 m_savepath = tBox1.Text;
                 this.DialogResult = DialogResult.OK;
-                this.Close();
             }
             
         }