找回密码
 立即注册

QQ登录

只需一步,快速开始

葡萄种子
金牌服务用户   /  发表于:2023-8-28 16:45  /   查看:1231  /  回复:4
本帖最后由 Joestar.Xu 于 2024-3-20 10:27 编辑

产品:GcExcel
版本:V6.1.4
问题编号:DOCXLS-8786
last review: 2024-3-20
该问题目前的计划是:在GcExcel V7.1版本中,会对整个模板功能进行重构。在整个重构之后接下来会对该问题进行修复。

模板绑定字段,然后字段里面可能存在null值,这个时候,模板渲染的结果是一个奇怪的数字。针对日期和字符串类型,甚至全列都是这个奇怪的数字,麻烦帮忙看看怎么回事。
  1. public class DemoJsonDatasource2 {
  2.     public static void main(String[] args) throws IOException {
  3.         Workbook workbook = new Workbook();
  4.         String rootPath = "";
  5.         String templateFile = rootPath+"24template.xlsx";
  6.         workbook.open(templateFile);
  7.         JsonDataSource datasource = new JsonDataSource("[" +
  8.                 "{"id":1,"intType":1,"floatType":1.1,"dateType":"2023-08-28","strType":"str1"}," +
  9.                 "{"id":2,"intType":null,"floatType":1.2,"dateType":"2023-08-28","strType":"str2"}," +
  10.                 "{"id":3,"intType":3,"floatType":null,"dateType":"2023-08-28","strType":"str3"}," +
  11.                 "{"id":4,"intType":4,"floatType":1.4,"dateType":null,"strType":"str4"}," +
  12.                 "{"id":5,"intType":5,"floatType":1.5,"dateType":"2023-08-28","strType":null}" +
  13.                 "]"
  14.         );
  15.         workbook.addDataSource("ds", datasource);
  16.         workbook.processTemplate();
  17.         workbook.save(rootPath+"24result.xlsx");
  18.     }
  19. }
复制代码



gc-excel-test24.zip

11.65 KB, 下载次数: 59

4 个回复

倒序浏览
葡萄种子
金牌服务用户   /  发表于:2023-8-28 16:47:46
沙发
image.png887760925.png
结果截图
回复 使用道具 举报
Joestar.XuSpreadJS 开发认证
超级版主   /  发表于:2023-8-28 18:21:14
板凳
您好,问题已重现,这边调研一下,后续有进展我会在本贴中回复您。

本帖先做保留处理了。
SpreadJS 17.0.9 | GcExcel 7.1.2 已发布~
回复 使用道具 举报
Joestar.XuSpreadJS 开发认证
超级版主   /  发表于:2023-9-1 10:02:42
地板
您好,该问题已被确认为是一个Bug,目前正在修复中,等修复完毕我会在帖子下回复您。
SpreadJS 17.0.9 | GcExcel 7.1.2 已发布~
回复 使用道具 举报
Clark.Pan讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2023-10-19 13:16:42
5#
您好,该问题目前的计划是:
在GcExcel V7.0版本中,会对整个模板功能进行重构。
在整个重构之后接下来会对该问题进行修复。
请您耐心等待,有进一步的情况我会在本帖中将信息共享给您。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部