The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx Workbook
The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx Workbook 创建单元格样式时,有64000个单元格创建了单元格样式,导致报错
如题,创建单元格样式时,有64000个单元格创建了单元格样式,导致报错,网上对此问题回复大都是 “创建单元格放在for循环外面”,那一个实例的情况下但凡有一个单元格修改样式就会覆盖其它所有,显然是解决不了问题的。
这个关键点在于 workbook.createCellStyle();
看源码:
每次创建会计数,大于 MAXIMUM_STYLE_ID
这个常量就会抛异常
接着看CellStyle子类只有2个:
且都实现了 org.apache.poi.common.Duplicatable
接口
这里有个copy方法且子类都有实现,那么只需要创建一个实例然后copy(),跳过workbook.createCellStyle();
的计数,就不会超出 MAXIMUM_STYLE_ID
常量了
修改后代码:
稍加改造下就可以解决这个问题
The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx Workbook相关推荐
- Java-The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx
一.异常日志: 2022-07-04 15:37:52,255 ERROR [http-nio-9202-exec-4] [frond-tmc,,,true] [ExportExcelMoreShee ...
- Failed to connect to database. Maximum number of connections to instance exceeded
使用ArcGIS Desktop连接sde,提示Failed to connect to database. Maximum number of conections to instance exce ...
- maximum number (256) of shader keywords exceeded unity的报错解决方法
https://bitbucket.org/ArtIsDarkGames/shader-keywords-tool-unity3d/src/master/ https://eternity429.wo ...
- [Unity]ShaderGraph问题所有材质丢失Maximum number (256) of shader keywords exceeded
2018.2.18f个人64位 Maximum number (256) of shader keywords exceeded 可能需要删除一些shader 把Edit- ProjectSettin ...
- exchange2013警告The maximum number of concurrent connections has exceeded a limit
警告如图示: 这是由于exchange 接收连接器有并发限制. 可以按照如下命令查询: 使用如下命令修改: 可以看到 修改成功了. 同时,前端和后端服务器的接收连接器都要改.
- openstack创建实例报错Exceeded maximum number of retries
Error: 实例 "vm2" 执行所请求操作失败,实例处于错误状态.: 请稍后再试 [错误: Exceeded maximum number of retries. Exceed ...
- Oracle 数据库设置最大进程数参数方法,oracle最大进程数满了处理方法,sysdba管理员登录报“maximum number of processes (150) exceeded“问题解决
oracle 数据库使用 sysdba 管理员登录报: ORA-00020: maximum number of processes (150) exceeded 译:超过了最大进程数(150) 方法 ...
- ORA-00018: maximum number of sessions exceeded 超出最大会话数
ORA-00018: maximum number of sessions exceeded ORA-00018: 超出最大会话数 Cause: All session state obj ...
- Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance
Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance
最新文章
- php博客浏览人数,在博客中实现浏览次数的统计
- MySQL修改数据表(ALTER TABLE语句)
- Apache CXF实现WebService发布和调用
- VTK:模型之Bottle
- 爬虫系统Lucene分词
- openstack常用运维命令_运维人员常用的Linux命令汇总
- 电脑脱机状态怎么解除_win7系统如何解除脱机工作 win7系统解除脱机工作步骤【介绍】...
- 计算机创新创业选题参考,计算机及相关专创新创业教育指导书.doc
- 信捷XD5程序+TG765触摸屏程序,功能为XY双轴排版机
- 机器学习如何影响系统设计:Learned Index Structures浅析
- 五线谱如何快速修改谱号,Overture这个小技巧必须要掌握!
- MySQL 查询统计订单
- Ubuntu18.04使用x86(32位)交叉编译工具链
- Python-10.1-面向对象
- 京东云擎 php,为什么我登陆京东云擎控制台会错误?
- Modbus Slave学习笔记
- Android之世面上程序锁的实现
- stm32使用dsp库,结合Matlab进行FIR滤波器设计
- 详解酒店IPTV系统 -- -南京邮电大学 江凌云
- 2021数学建模国赛(后续)