366 Star 3.5K Fork 1.5K

JEECG / JimuReport

 / 详情

报表导出时,出现错误:The maximum number of Cell Styles was exceeded

Done
Opened this issue  
2022-04-14 11:37
版本号:

1.4.2

问题描述:

报表导出时,出现错误:The maximum number of Cell Styles was exceeded
2022-04-14 11:17:48.118 ERROR 1 --- [io-8085-exec-10] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx Workbook] with root cause

java.lang.IllegalStateException: The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx Workbook
at org.apache.poi.xssf.model.StylesTable.createCellStyle(StylesTable.java:815) ~[poi-ooxml-3.17.jar!/:3.17]
at org.apache.poi.xssf.usermodel.XSSFWorkbook.createCellStyle(XSSFWorkbook.java:730) ~[poi-ooxml-3.17.jar!/:3.17]
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createCellStyle(SXSSFWorkbook.java:858) ~[poi-ooxml-3.17.jar!/:3.17]
at org.jeecg.modules.jmreport.desreport.service.a.k.a(JmReportExportExcelImpl.java:1006) ~[jimureport-spring-boot-starter-1.4.2.jar!/:2.0.0]
at org.jeecg.modules.jmreport.desreport.service.a.k.a(JmReportExportExcelImpl.java:779) ~[jimureport-spring-boot-starter-1.4.2.jar!/:2.0.0]
at org.jeecg.modules.jmreport.desreport.service.a.k.a(JmReportExportExcelImpl.java:578) ~[jimureport-spring-boot-starter-1.4.2.jar!/:2.0.0]
at org.jeecg.modules.jmreport.desreport.service.a.k.a(JmReportExportExcelImpl.java:238) ~[jimureport-spring-boot-starter-1.4.2.jar!/:2.0.0]
at org.jeecg.modules.jmreport.desreport.service.a.k.exportExcel(JmReportExportExcelImpl.java:117) ~[jimureport-spring-boot-starter-1.4.2.jar!/:2.0.0]
at org.jeecg.modules.jmreport.desreport.a.a.b$original$W37edslQ(DesignReportController.java:1069) ~[jimureport-spring-boot-starter-1.4.2.jar!/:2.0.0]
at org.jeecg.modules.jmreport.desreport.a.a.b$original$W37edslQ$accessor$YS4jC0RS(DesignReportController.java) ~[jimureport-spring-boot-starter-1.4.2.jar!/:2.0.0]

错误日志&截图:

输入图片说明

重现步骤:

1。查询报表,导出excel

友情提示(为了提高issue处理效率):

  • 积木报表是一款免费报表产品,功能免费源码不开放;
  • 未按格式要求发帖,会被直接删掉;
  • 请针对问题提供报表设计SQL脚本或在官网制作报表示例并提供ID;
  • 针对不好重现的问题,请录制操作视频或详细的重现步骤;

Comments (10)

孙保金 created任务

请导出报表配置,我们复现一下

怎么导出报表配置?
输入图片说明

输入图片说明
鼠标右键。滑轮下滑就看到了

insert into jimu_report(api_code,create_time,name,template,del_flag,id,view_count,note,status,thumb,update_time,create_by,api_url,type,css_str,update_by,js_str,code,json_str,api_method) values (null,'2022-04-13 09:58:18','【仓储管理】其它入库单明细',0,0,'674039281837690880','12',null,null,null,'2022-04-14 10:52:04','admin',null,'datainfo',null,'admin',null,'20211228161106990205846669','{"loopBlockList":[],"area":{"sri":1,"sci":7,"eri":1,"eci":7,"width":100,"height":25},"excel_config_id":"674039281837690880","printConfig":{"paper":"A4","width":210,"height":297,"definition":1,"isBackend":false,"marginX":10,"marginY":10,"layout":"portrait"},"zonedEditionList":[],"rows":{"0":{"cells":{"0":{"text":"核算主体编码","style":1},"1":{"text":"核算主体名称","style":1},"2":{"text":"业务编码","style":1},"3":{"text":"业务日期","style":1},"4":{"text":"单据状态","style":1},"5":{"text":"仓库编码","style":1},"6":{"text":"仓库名称","style":1},"7":{"text":"中台SPU","style":1},"8":{"text":"外部SPU","style":1},"9":{"text":"中台SKU","style":1},"10":{"text":"商品名称","style":1,"rendered":"","config":""},"11":{"text":"国际条码","style":1,"rendered":"","config":""},"12":{"text":"数量","style":1,"rendered":"","config":""}}},"1":{"cells":{"0":{"text":"#{XS0001.核算主体编码}","style":0,"rendered":"","config":""},"1":{"text":"#{XS0001.核算主体名称}","style":0},"2":{"text":"#{XS0001.业务编码}","style":0},"3":{"text":"#{XS0001.业务日期}","style":0},"4":{"text":"#{XS0001.单据状态}","style":0},"5":{"text":"#{XS0001.仓库编码}","style":0},"6":{"text":"#{XS0001.仓库名称}","style":0},"7":{"text":"#{XS0001.中台spu}","style":0,"rendered":"","config":""},"8":{"text":"#{XS0001.外部spu}","style":0},"9":{"text":"#{XS0001.中台sku}","style":0,"decimalPlaces":"0"},"10":{"text":"#{XS0001.商品名称}","style":0},"11":{"text":"#{XS0001.国际条码}","style":0,"rendered":"","config":""},"12":{"text":"#{XS0001.数量}","style":2,"rendered":"","config":"","display":"number","decimalPlaces":"0"}}},"2":{"cells":{}},"3":{"cells":{}},"len":100},"dbexps":[],"dicts":[],"rpbar":{"show":true,"pageSize":"","btnList":[]},"freeze":"A1","dataRectWidth":1509,"displayConfig":{},"background":false,"name":"sheet1","autofilter":{},"styles":[{"border":{"bottom":["thin","#000"],"top":["thin","#000"],"left":["thin","#000"],"right":["thin","#000"]}},{"border":{"bottom":["thin","#000"],"top":["thin","#000"],"left":["thin","#000"],"right":["thin","#000"]},"bgcolor":"#01b0f1"},{"border":{"bottom":["thin","#000"],"top":["thin","#000"],"left":["thin","#000"],"right":["thin","#000"]},"format":"number"}],"validations":[],"cols":{"0":{"width":144},"1":{"width":149},"2":{"width":124},"3":{"width":139},"4":{"width":153},"len":50},"merges":[]}',null);
insert into jimu_report_db(db_code,db_ch_name,is_list,create_time,db_type,db_key,db_source,id,jimu_report_id,db_dyn_sql,is_page,update_time,tb_db_table_name,create_by,api_url,json_data,db_table_name,update_by,tb_db_key,java_type,java_value,api_method,api_convert,db_source_type) values ('XS0001','【仓储管理】其它入库单明细','1','2022-04-13 09:58:18','0',null,'635718892295094272','674039281867051008','674039281837690880','SELECT
s1.ref_obj01 核算主体编码,
u1."name" 核算主体名称,
s1.record_code 业务编码,
to_char(s1.record_date,''YYYY-MM-DD'') 业务日期,
s1.in_warehouse_code 仓库编码,
s3.real_warehouse_name 仓库名称,
s2.sku_code skucode,
s2.sku_quantity 数量,
b1.dict_item_name 单据状态,
ic1.*
FROM
sc_rw_front_record s1
INNER JOIN sc_rw_front_record_detail s2 ON s1.record_code = s2.record_code
AND s2.deleted = ''f''
LEFT JOIN uc_accounting_subject u1 ON s1.ref_obj01 = u1.code
AND u1.deleted = ''f''
left join bsc_dict_item b1 on b1.dict_code =''WO00014'' and b1.deleted =''f'' and b1.dict_item_code = s1.record_status||''''
left join sc_real_warehouse s3 on s1.in_warehouse_code = s3.real_warehouse_code and s3.deleted =''f''
left join (
SELECT
i2.item_code 中台SPU,
i2.external_code 外部SPU,
i1.sku_code 中台SKU,
i1."name" 商品名称,
i3.code 国际条码
FROM
ic_sku i1
INNER JOIN ic_item i2 ON i1.item_id = i2.ID
AND i2.deleted = ''f''
LEFT JOIN ic_sku_eancode i3 ON i1.sku_code = i3.sku_code
AND i3.deleted = ''f''
AND i3.TYPE = ''10''
WHERE
i1.deleted = ''f''
) ic1 on s2.sku_code = ic1.中台SKU
WHERE
s1.deleted = ''f''
AND s1.record_type = 50
AND s1.delivery_type = ''0'' ','1','2022-04-12 17:34:47',null,'admin',null,'',null,'admin',null,null,null,null,'','postgresql');
insert into jimu_report_db_field(create_time,widget_type,order_num,search_mode,field_text,dict_code,id,search_flag,update_time,create_by,jimu_report_db_id,widget_width,search_value,update_by,field_name,search_format,ext_json) values ('2022-04-13 09:58:18',null,0,null,'数量',null,'674039281883828224',0,null,'admin','674039281867051008',null,null,null,'数量',null,'');
insert into jimu_report_db_field(create_time,widget_type,order_num,search_mode,field_text,dict_code,id,search_flag,update_time,create_by,jimu_report_db_id,widget_width,search_value,update_by,field_name,search_format,ext_json) values ('2022-04-13 09:58:18','String',1,3,'核算主体编码',null,'674039281892216832',1,null,'admin','674039281867051008',null,null,null,'核算主体编码',null,'');
insert into jimu_report_db_field(create_time,widget_type,order_num,search_mode,field_text,dict_code,id,search_flag,update_time,create_by,jimu_report_db_id,widget_width,search_value,update_by,field_name,search_format,ext_json) values ('2022-04-13 09:58:18','String',2,3,'核算主体名称',null,'674039281896411136',1,null,'admin','674039281867051008',null,null,null,'核算主体名称',null,'');
insert into jimu_report_db_field(create_time,widget_type,order_num,search_mode,field_text,dict_code,id,search_flag,update_time,create_by,jimu_report_db_id,widget_width,search_value,update_by,field_name,search_format,ext_json) values ('2022-04-13 09:58:18','String',3,5,'商品名称',null,'674039281904799744',1,null,'admin','674039281867051008',null,null,null,'商品名称',null,'');
insert into jimu_report_db_field(create_time,widget_type,order_num,search_mode,field_text,dict_code,id,search_flag,update_time,create_by,jimu_report_db_id,widget_width,search_value,update_by,field_name,search_format,ext_json) values ('2022-04-13 09:58:18',null,4,5,'业务编码',null,'674039281908994048',1,null,'admin','674039281867051008',null,null,null,'业务编码',null,'');
insert into jimu_report_db_field(create_time,widget_type,order_num,search_mode,field_text,dict_code,id,search_flag,update_time,create_by,jimu_report_db_id,widget_width,search_value,update_by,field_name,search_format,ext_json) values ('2022-04-13 09:58:18','date',6,2,'业务日期',null,'674039281913188352',1,null,'admin','674039281867051008',null,'=concat(string.substring(dateStr(''yyyy-MM-dd''),0, 8), ''01'')|=dateStr(''yyyy-MM-dd'')',null,'业务日期',null,'');
insert into jimu_report_db_field(create_time,widget_type,order_num,search_mode,field_text,dict_code,id,search_flag,update_time,create_by,jimu_report_db_id,widget_width,search_value,update_by,field_name,search_format,ext_json) values ('2022-04-13 09:58:18','String',6,3,'仓库编码',null,'674039281921576960',1,null,'admin','674039281867051008',null,null,null,'仓库编码',null,'');
insert into jimu_report_db_field(create_time,widget_type,order_num,search_mode,field_text,dict_code,id,search_flag,update_time,create_by,jimu_report_db_id,widget_width,search_value,update_by,field_name,search_format,ext_json) values ('2022-04-13 09:58:18','String',6,3,'仓库名称',null,'674039281925771264',1,null,'admin','674039281867051008',null,null,null,'仓库名称',null,'');
insert into jimu_report_db_field(create_time,widget_type,order_num,search_mode,field_text,dict_code,id,search_flag,update_time,create_by,jimu_report_db_id,widget_width,search_value,update_by,field_name,search_format,ext_json) values ('2022-04-13 09:58:18','String',7,3,'单据状态',null,'674039281929965568',1,null,'admin','674039281867051008',null,null,null,'单据状态',null,'');
insert into jimu_report_db_field(create_time,widget_type,order_num,search_mode,field_text,dict_code,id,search_flag,update_time,create_by,jimu_report_db_id,widget_width,search_value,update_by,field_name,search_format,ext_json) values ('2022-04-13 09:58:18',null,8,5,'中台spu',null,'674039281934159872',1,null,'admin','674039281867051008',null,null,null,'中台spu',null,'');
insert into jimu_report_db_field(create_time,widget_type,order_num,search_mode,field_text,dict_code,id,search_flag,update_time,create_by,jimu_report_db_id,widget_width,search_value,update_by,field_name,search_format,ext_json) values ('2022-04-13 09:58:18','String',9,5,'外部spu',null,'674039281942548480',1,null,'admin','674039281867051008',null,null,null,'外部spu',null,'');
insert into jimu_report_db_field(create_time,widget_type,order_num,search_mode,field_text,dict_code,id,search_flag,update_time,create_by,jimu_report_db_id,widget_width,search_value,update_by,field_name,search_format,ext_json) values ('2022-04-13 09:58:18','String',10,5,'中台sku',null,'674039281946742784',1,null,'admin','674039281867051008',null,null,null,'中台sku',null,'');
insert into jimu_report_db_field(create_time,widget_type,order_num,search_mode,field_text,dict_code,id,search_flag,update_time,create_by,jimu_report_db_id,widget_width,search_value,update_by,field_name,search_format,ext_json) values ('2022-04-13 09:58:18','String',11,5,'skucode',null,'674039281950937088',0,null,'admin','674039281867051008',null,null,null,'skucode',null,'');
insert into jimu_report_db_field(create_time,widget_type,order_num,search_mode,field_text,dict_code,id,search_flag,update_time,create_by,jimu_report_db_id,widget_width,search_value,update_by,field_name,search_format,ext_json) values ('2022-04-13 09:58:18','String',12,5,'国际条码',null,'674039281959325696',1,null,'admin','674039281867051008',null,null,null,'国际条码',null,'');

它是和你的style样式有关,我看你的style才5条,我测试300多条,分了200个sheet,导出数据20万条都没有报错,如果方便的话请提供一下表结构和数据,重现问题的测试数据即可,也有可能和你的数据有关
输入图片说明

我本地的示例
输入图片说明

文件已上传

输入图片说明

又有一个报错了

已修复,待新版本发布

lvdandan changed issue state from 待办的 to 已完成

Sign in to comment

Status
Assignees
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
参与者(3)
Java
1
https://gitee.com/jeecg/JimuReport.git
git@gitee.com:jeecg/JimuReport.git
jeecg
JimuReport
JimuReport

Search