Просмотр исходного кода

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

yuqian лет назад: 8
Родитель
Сommit
2998be9532
1 измененных файлов с 19 добавлено и 18 удалено
  1. 19 18
      CallCenterCommon/CallCenter.Utility/NPOI/NPOIHelper.cs

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

@@ -57,7 +57,7 @@ namespace CallCenter.Utility
57 57
                 {
58 58
                     row.CreateCell(i).SetCellValue(table.Columns[i].ColumnName);
59 59
                     row.Height = 350;
60
-                    sheet.AutoSizeColumn(i);
60
+                    //sheet.AutoSizeColumn(i);
61 61
                 }
62 62
             }
63 63
             else
@@ -66,7 +66,7 @@ namespace CallCenter.Utility
66 66
                 {
67 67
                     row.CreateCell(i).SetCellValue(columns[i]);
68 68
                     row.Height = 350;
69
-                    sheet.AutoSizeColumn(i);
69
+                    //sheet.AutoSizeColumn(i);
70 70
                 }
71 71
             }
72 72
 
@@ -198,11 +198,11 @@ namespace CallCenter.Utility
198 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 207
                 using (MemoryStream ms = new MemoryStream())
208 208
                 {
@@ -364,11 +364,11 @@ namespace CallCenter.Utility
364 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 374
                 using (MemoryStream ms = new MemoryStream())
@@ -511,11 +511,12 @@ namespace CallCenter.Utility
511 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 522
                 using (MemoryStream ms = new MemoryStream())
@@ -564,7 +565,7 @@ namespace CallCenter.Utility
564 565
                 for (int iColumnIndex = 0; iColumnIndex < 10; iColumnIndex++)
565 566
                 {
566 567
                     RowBody.CreateCell(iColumnIndex).SetCellValue(DateTime.Now.Millisecond);
567
-                    sheet.AutoSizeColumn(iColumnIndex);
568
+                    //sheet.AutoSizeColumn(iColumnIndex);
568 569
                 }
569 570
             }
570 571
             return sheet;