本帖最后由 Joestar.Xu 于 2023-8-18 09:23 编辑
"指数"为隐藏页,SpreadJS v16.2.0、GCEXCEL v6.2.0
通过谷歌浏览器保存的ssjson文件,被GCEXCEL打开之后,无法根据工作表名称获取工作表对象。复现代码如下:- Workbook workbook = new Workbook();
- weekbook.fromJson("谷歌保存的json文件");
- IWorksheet worksheet = weekbook.getWorksheets().get("指数");
复制代码 通过debug查看 worksheet = null
此时采用如下代码打印所有工作表名称:- for (int i=0;i<weekbook.getWorksheets().getCount();i++){
- IWorksheet worksheet1 = weekbook.getWorksheets().get(i);
- log.info("worksheet num:{}-name:{}",i,worksheet1.getName());
- }
复制代码 显示结果如下:
12:27:53.316 [http-nio-8080-exec-2] INFO c.r.e.i.EpExcelUtilServiceImpl - [getWeekReportExcelSWData,1826] - worksheet num:0-name:Office
12:27:53.317 [http-nio-8080-exec-2] INFO c.r.e.i.EpExcelUtilServiceImpl - [getWeekReportExcelSWData,1826] - worksheet num:1-name:Office
12:27:53.317 [http-nio-8080-exec-2] INFO c.r.e.i.EpExcelUtilServiceImpl - [getWeekReportExcelSWData,1826] - worksheet num:2-name:Office
12:27:53.317 [http-nio-8080-exec-2] INFO c.r.e.i.EpExcelUtilServiceImpl - [getWeekReportExcelSWData,1826] - worksheet num:3-name:Office
12:27:53.317 [http-nio-8080-exec-2] INFO c.r.e.i.EpExcelUtilServiceImpl - [getWeekReportExcelSWData,1826] - worksheet num:4-name:Office
12:27:53.317 [http-nio-8080-exec-2] INFO c.r.e.i.EpExcelUtilServiceImpl - [getWeekReportExcelSWData,1826] - worksheet num:5-name:Office
12:27:53.317 [http-nio-8080-exec-2] INFO c.r.e.i.EpExcelUtilServiceImpl - [getWeekReportExcelSWData,1826] - worksheet num:6-name:Office
12:27:53.317 [http-nio-8080-exec-2] INFO c.r.e.i.EpExcelUtilServiceImpl - [getWeekReportExcelSWData,1826] - worksheet num:7-name:Office
12:27:53.318 [http-nio-8080-exec-2] INFO c.r.e.i.EpExcelUtilServiceImpl - [getWeekReportExcelSWData,1826] - worksheet num:8-name:Office
电脑自带的edge浏览器保存后数据,GCEXCEL根据工作表名称获取工作表对象是可以读取到的
|
|