Excel样式循环报错

导出 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();如果有,不要放到循环中,在循环外面创建好了,再放到代码中引用。

猜你喜欢

转载自blog.csdn.net/qq_36826506/article/details/84326734