Ver Fonte

Reapply "fix:单元格超出最大范围"

This reverts commit d93b91979ad4ec662c29385f2424c12e6630bf9f.
ly há 11 meses atrás
pai
commit
9db6d8e638

+ 6 - 1
src/main/java/cn/ezhizao/common/utils/poi/ExcelUtil.java

@@ -913,7 +913,12 @@ public class ExcelUtil<T>
                     }
                 }
             }
-            sheet.setColumnWidth(columnNum, columnWidth * 256);
+            if(30 * 256 * 3 > columnWidth * 256){
+                sheet.setColumnWidth(columnNum, columnWidth * 256);
+            }else{
+                sheet.setColumnWidth(columnNum, 30 * 256 * 3);
+            }
+
         }
     }