Explorar el Código

导出报表优化 NPOI去掉sheet.AutoSizeColumn(i);

yuqian %!s(int64=8) %!d(string=hace) años
padre
commit
2998be9532
Se han modificado 1 ficheros con 19 adiciones y 18 borrados
  1. 19 18
      CallCenterCommon/CallCenter.Utility/NPOI/NPOIHelper.cs

+ 19 - 18
CallCenterCommon/CallCenter.Utility/NPOI/NPOIHelper.cs

57
                 {
57
                 {
58
                     row.CreateCell(i).SetCellValue(table.Columns[i].ColumnName);
58
                     row.CreateCell(i).SetCellValue(table.Columns[i].ColumnName);
59
                     row.Height = 350;
59
                     row.Height = 350;
60
-                    sheet.AutoSizeColumn(i);
60
+                    //sheet.AutoSizeColumn(i);
61
                 }
61
                 }
62
             }
62
             }
63
             else
63
             else
66
                 {
66
                 {
67
                     row.CreateCell(i).SetCellValue(columns[i]);
67
                     row.CreateCell(i).SetCellValue(columns[i]);
68
                     row.Height = 350;
68
                     row.Height = 350;
69
-                    sheet.AutoSizeColumn(i);
69
+                    //sheet.AutoSizeColumn(i);
70
                 }
70
                 }
71
             }
71
             }
72
 
72
 
198
                         iRowIndex++;
198
                         iRowIndex++;
199
                     }
199
                     }
200
 
200
 
201
-                    //自适应列宽度
202
-                    for (int i = 0; i < icolIndex; i++)
203
-                    {
204
-                        sheet.AutoSizeColumn(i);
205
-                    }
201
+                    ////自适应列宽度
202
+                    //for (int i = 0; i < icolIndex; i++)
203
+                    //{
204
+                    //    sheet.AutoSizeColumn(i);
205
+                    //}
206
                 }
206
                 }
207
                 using (MemoryStream ms = new MemoryStream())
207
                 using (MemoryStream ms = new MemoryStream())
208
                 {
208
                 {
364
                             iRowIndex++;
364
                             iRowIndex++;
365
                         }
365
                         }
366
 
366
 
367
-                        //自适应列宽度
368
-                        for (int i = 0; i < icolIndex; i++)
369
-                        {
370
-                            sheet.AutoSizeColumn(i);
371
-                        }
367
+                        ////自适应列宽度
368
+                        //for (int i = 0; i < icolIndex; i++)
369
+                        //{
370
+                        //    sheet.AutoSizeColumn(i);
371
+                        //}
372
                     }
372
                     }
373
                 }
373
                 }
374
                 using (MemoryStream ms = new MemoryStream())
374
                 using (MemoryStream ms = new MemoryStream())
511
                             iRowIndex++;
511
                             iRowIndex++;
512
                         }
512
                         }
513
 
513
 
514
-                        //自适应列宽度
515
-                        for (int i = 0; i < icolIndex; i++)
516
-                        {
517
-                            sheet.AutoSizeColumn(i);
518
-                        }
514
+                        ////自适应列宽度
515
+                        //for (int i = 0; i < icolIndex; i++)
516
+                        //{
517
+                        //    sheet.AutoSizeColumn(i);
518
+                        //}
519
+
519
                     }
520
                     }
520
                 }
521
                 }
521
                 using (MemoryStream ms = new MemoryStream())
522
                 using (MemoryStream ms = new MemoryStream())
564
                 for (int iColumnIndex = 0; iColumnIndex < 10; iColumnIndex++)
565
                 for (int iColumnIndex = 0; iColumnIndex < 10; iColumnIndex++)
565
                 {
566
                 {
566
                     RowBody.CreateCell(iColumnIndex).SetCellValue(DateTime.Now.Millisecond);
567
                     RowBody.CreateCell(iColumnIndex).SetCellValue(DateTime.Now.Millisecond);
567
-                    sheet.AutoSizeColumn(iColumnIndex);
568
+                    //sheet.AutoSizeColumn(iColumnIndex);
568
                 }
569
                 }
569
             }
570
             }
570
             return sheet;
571
             return sheet;