POI导出excel报错:The maximum number of cell styles was exceeded. You can define up to 4000 styles in a .
java.lang.IllegalStateException: The maximum number of cell styles was exceeded. You can define up to 4000 styles in a .xls workbook
at org.apache.poi.hssf.usermodel.HSSFWorkbook.createCellStyle(HSSFWorkbook.java:1262) ~[poi-4.1.2.jar:4.1.2]
原因是由于创建了太多的 cell styles,所以一般把cellstyle设置放到循环外面