Kaynağa Gözat

优化 颗粒 列表 导出 execl 速度

cxs 1 yıl önce
ebeveyn
işleme
7bf381043d

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

@@ -1888,6 +1888,8 @@ namespace OTSIncAReportGrids
 
                 //插入表头
                 row = sheet.CreateRow(1);//从第15行添加一行
+                IDrawing patriarch;
+                patriarch = sheet.CreateDrawingPatriarch();
                 row.Height = 30 * 20;
                 for (int i_cell = 0; i_cell < dgV_ParticlesDevidePage.Columns.Count; i_cell++)
                 {
@@ -1897,7 +1899,7 @@ namespace OTSIncAReportGrids
                     cell.SetCellValue(dgV_ParticlesDevidePage.Columns[i_cell].HeaderText);
                 }
 
-                IDrawing patriarch;
+               
                 IClientAnchor anchor;
                 int pictureIdx;
                 Bitmap bp;
@@ -1929,7 +1931,7 @@ namespace OTSIncAReportGrids
                                 pictureIdx = workbook.AddPicture(bytes, PictureType.JPEG);
 
                                 //第三步,在sheet中创建画布
-                                patriarch = sheet.CreateDrawingPatriarch();
+                             
 
                                 //第四步,设置锚点,(在起始单元格的X坐标0-1023,Y的坐标0-255,在终止单元格的X坐标0-1023,Y的坐标0-255,起始单元格行数,列数,终止单元格行数,列数)
                                 anchor = patriarch.CreateAnchor(1, 1, 2, 2, i_cell, i_row + 2, i_cell + 1, i_row + 3);//终止比开始位置大1,会自动缩放到一个单元格内的
@@ -1941,6 +1943,7 @@ namespace OTSIncAReportGrids
                         else
                         {
                             //非图像列
+                            
                             cell.SetCellValue(dgV_ParticlesDevidePage[i_cell, i_row].Value.ToString());
                         }