导出 Excel数据多报错:java.lang.IllegalStateException: The maximum number of cell styles was exceeded. You can define up to 4000 styles in a .xls workbook
代码创建的cellSyle太多了。在循环中调用了HSSFCellStyle cellStyle = wb.createCellStyle();如果有,不要放到循环中,在循环外面创建好了,再放到代码中引用。
错误代码:
正确代码: