找回密码
 立即注册

QQ登录

只需一步,快速开始

10E32
注册会员   /  发表于:2022-7-5 14:31  /   查看:3544  /  回复:8
1金币
本帖最后由 Lynn.Dou 于 2022-7-8 12:17 编辑

json是其他excel区域toJson生成的。
可以执行一下下面的代码试试。
Workbook workbook = new Workbook();
IWorksheet worksheet = workbook.getWorksheets().get(0);
worksheet.getRange(0,3,4,5).fromJson("{\"0\":{\"3\":{\"value\":\"身故发生率乘数因子\",\"style\":{\"backColor\":\"rgb(0,32,96)\",\"font\":\"normal bold 11pt 'Microsoft YaHei Light',sans-serif\",\"textDecoration\":0,\"foreColor\":\"Background 1\",\"borderLeft\":{\"style\":0},\"borderTop\":{\"style\":0},\"borderRight\":{\"style\":0},\"borderBottom\":{\"style\":0},\"borderHorizontal\":{\"style\":0},\"borderVertical\":{\"style\":0},\"locked\":true,\"hAlign\":1,\"vAlign\":1,\"textIndent\":0,\"wordWrap\":true,\"shrinkToFit\":false,\"formatter\":\"General\",\"quotePrefix\":false}},\"4\":{\"style\":{\"backColor\":\"Text 2 80\",\"font\":\"normal bold 11pt 'Microsoft YaHei Light',sans-serif\",\"textDecoration\":0,\"foreColor\":\"Background 1\",\"borderLeft\":{\"style\":0},\"borderTop\":{\"style\":0},\"borderRight\":{\"style\":0},\"borderBottom\":{\"style\":0},\"borderHorizontal\":{\"style\":0},\"borderVertical\":{\"style\":0},\"locked\":true,\"hAlign\":1,\"vAlign\":1,\"textIndent\":0,\"wordWrap\":true,\"shrinkToFit\":false,\"formatter\":\"General\",\"quotePrefix\":false}}},\"1\":{\"3\":{\"value\":\"性别\",\"style\":{\"backColor\":\"Accent 5 -50\",\"font\":\"normal bold 11pt 'Microsoft YaHei Light',sans-serif\",\"textDecoration\":0,\"foreColor\":\"Background 1\",\"borderLeft\":{\"style\":0},\"borderTop\":{\"style\":0},\"borderRight\":{\"style\":0},\"borderBottom\":{\"style\":0},\"borderHorizontal\":{\"style\":0},\"borderVertical\":{\"style\":0},\"locked\":true,\"hAlign\":1,\"vAlign\":1,\"textIndent\":0,\"wordWrap\":false,\"shrinkToFit\":false,\"formatter\":\"General\",\"quotePrefix\":false}},\"4\":{\"value\":\"乘数因子\",\"style\":{\"backColor\":\"Accent 5 -50\",\"font\":\"normal bold 11pt 'Microsoft YaHei Light',sans-serif\",\"textDecoration\":0,\"foreColor\":\"Background 1\",\"borderLeft\":{\"style\":0},\"borderTop\":{\"style\":0},\"borderRight\":{\"style\":0},\"borderBottom\":{\"style\":0},\"borderHorizontal\":{\"style\":0},\"borderVertical\":{\"style\":0},\"locked\":true,\"hAlign\":1,\"vAlign\":1,\"textIndent\":0,\"wordWrap\":false,\"shrinkToFit\":false,\"formatter\":\"General\",\"quotePrefix\":false}}},\"2\":{\"3\":{\"value\":{\"richText\":[{\"style\":{\"foreColor\":\"Background 1\",\"font\":\" bold 9pt 'Microsoft YaHei Light',sans-serif\",\"vertAlign\":0},\"text\":\"\"}]},\"style\":{\"backColor\":\"Accent 5 -50\",\"font\":\"normal bold 9pt Arial,sans-serif\",\"textDecoration\":0,\"foreColor\":\"Background 1\",\"borderLeft\":{\"style\":0},\"borderTop\":{\"style\":0},\"borderRight\":{\"style\":0},\"borderBottom\":{\"style\":0},\"borderHorizontal\":{\"style\":0},\"borderVertical\":{\"style\":0},\"locked\":true,\"hAlign\":1,\"vAlign\":1,\"textIndent\":0,\"wordWrap\":false,\"shrinkToFit\":false,\"formatter\":\"General\",\"quotePrefix\":false}},\"4\":{\"value\":1.0,\"style\":{\"backColor\":\"Accent 5 40\",\"font\":\"normal bold 9pt Arial,sans-serif\",\"textDecoration\":0,\"foreColor\":\"Text 1 5\",\"borderLeft\":{\"style\":0},\"borderTop\":{\"style\":0},\"borderRight\":{\"style\":0},\"borderBottom\":{\"style\":0},\"borderHorizontal\":{\"style\":0},\"borderVertical\":{\"style\":0},\"locked\":true,\"hAlign\":1,\"vAlign\":1,\"textIndent\":0,\"wordWrap\":false,\"shrinkToFit\":false,\"formatter\":\"0.00%\",\"quotePrefix\":false}}},\"3\":{\"3\":{\"value\":{\"richText\":[{\"style\":{\"foreColor\":\"Background 1\",\"font\":\" bold 9pt 'Microsoft YaHei Light',sans-serif\",\"vertAlign\":0},\"text\":\"\"}]},\"style\":{\"backColor\":\"Accent 5 -50\",\"font\":\"normal bold 9pt Arial,sans-serif\",\"textDecoration\":0,\"foreColor\":\"Background 1\",\"borderLeft\":{\"style\":0},\"borderTop\":{\"style\":0},\"borderRight\":{\"style\":0},\"borderBottom\":{\"style\":0},\"borderHorizontal\":{\"style\":0},\"borderVertical\":{\"style\":0},\"locked\":true,\"hAlign\":1,\"vAlign\":1,\"textIndent\":0,\"wordWrap\":false,\"shrinkToFit\":false,\"formatter\":\"General\",\"quotePrefix\":false}},\"4\":{\"value\":1.0,\"style\":{\"backColor\":\"Accent 5 40\",\"font\":\"normal bold 9pt Arial,sans-serif\",\"textDecoration\":0,\"foreColor\":\"Text 1 5\",\"borderLeft\":{\"style\":0},\"borderTop\":{\"style\":0},\"borderRight\":{\"style\":0},\"borderBottom\":{\"style\":0},\"borderHorizontal\":{\"style\":0},\"borderVertical\":{\"style\":0},\"locked\":true,\"hAlign\":1,\"vAlign\":1,\"textIndent\":0,\"wordWrap\":false,\"shrinkToFit\":false,\"formatter\":\"0.00%\",\"quotePrefix\":false}}}}");

最佳答案

查看完整内容

您好,此问题已经在V5.1.5修复,升级版本即可解决问题

8 个回复

倒序浏览
最佳答案
最佳答案
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2022-7-5 14:31:04
来自 9#
您好,此问题已经在V5.1.5修复,升级版本即可解决问题
回复 使用道具 举报
10E32
注册会员   /  发表于:2022-7-5 14:49:41
2#
下面是未转义的串

{"0":{"3":{"value":"身故发生率乘数因子","style":{"backColor":"rgb(0,32,96)","font":"normal bold 11pt 'Microsoft YaHei Light',sans-serif","textDecoration":0,"foreColor":"Background 1","borderLeft":{"style":0},"borderTop":{"style":0},"borderRight":{"style":0},"borderBottom":{"style":0},"borderHorizontal":{"style":0},"borderVertical":{"style":0},"locked":true,"hAlign":1,"vAlign":1,"textIndent":0,"wordWrap":true,"shrinkToFit":false,"formatter":"General","quotePrefix":false}},"4":{"style":{"backColor":"Text 2 80","font":"normal bold 11pt 'Microsoft YaHei Light',sans-serif","textDecoration":0,"foreColor":"Background 1","borderLeft":{"style":0},"borderTop":{"style":0},"borderRight":{"style":0},"borderBottom":{"style":0},"borderHorizontal":{"style":0},"borderVertical":{"style":0},"locked":true,"hAlign":1,"vAlign":1,"textIndent":0,"wordWrap":true,"shrinkToFit":false,"formatter":"General","quotePrefix":false}}},"1":{"3":{"value":"性别","style":{"backColor":"Accent 5 -50","font":"normal bold 11pt 'Microsoft YaHei Light',sans-serif","textDecoration":0,"foreColor":"Background 1","borderLeft":{"style":0},"borderTop":{"style":0},"borderRight":{"style":0},"borderBottom":{"style":0},"borderHorizontal":{"style":0},"borderVertical":{"style":0},"locked":true,"hAlign":1,"vAlign":1,"textIndent":0,"wordWrap":false,"shrinkToFit":false,"formatter":"General","quotePrefix":false}},"4":{"value":"乘数因子","style":{"backColor":"Accent 5 -50","font":"normal bold 11pt 'Microsoft YaHei Light',sans-serif","textDecoration":0,"foreColor":"Background 1","borderLeft":{"style":0},"borderTop":{"style":0},"borderRight":{"style":0},"borderBottom":{"style":0},"borderHorizontal":{"style":0},"borderVertical":{"style":0},"locked":true,"hAlign":1,"vAlign":1,"textIndent":0,"wordWrap":false,"shrinkToFit":false,"formatter":"General","quotePrefix":false}}},"2":{"3":{"value":{"richText":[{"style":{"foreColor":"Background 1","font":" bold 9pt 'Microsoft YaHei Light',sans-serif","vertAlign":0},"text":"男"}]},"style":{"backColor":"Accent 5 -50","font":"normal bold 9pt Arial,sans-serif","textDecoration":0,"foreColor":"Background 1","borderLeft":{"style":0},"borderTop":{"style":0},"borderRight":{"style":0},"borderBottom":{"style":0},"borderHorizontal":{"style":0},"borderVertical":{"style":0},"locked":true,"hAlign":1,"vAlign":1,"textIndent":0,"wordWrap":false,"shrinkToFit":false,"formatter":"General","quotePrefix":false}},"4":{"value":1.0,"style":{"backColor":"Accent 5 40","font":"normal bold 9pt Arial,sans-serif","textDecoration":0,"foreColor":"Text 1 5","borderLeft":{"style":0},"borderTop":{"style":0},"borderRight":{"style":0},"borderBottom":{"style":0},"borderHorizontal":{"style":0},"borderVertical":{"style":0},"locked":true,"hAlign":1,"vAlign":1,"textIndent":0,"wordWrap":false,"shrinkToFit":false,"formatter":"0.00%","quotePrefix":false}}},"3":{"3":{"value":{"richText":[{"style":{"foreColor":"Background 1","font":" bold 9pt 'Microsoft YaHei Light',sans-serif","vertAlign":0},"text":"女"}]},"style":{"backColor":"Accent 5 -50","font":"normal bold 9pt Arial,sans-serif","textDecoration":0,"foreColor":"Background 1","borderLeft":{"style":0},"borderTop":{"style":0},"borderRight":{"style":0},"borderBottom":{"style":0},"borderHorizontal":{"style":0},"borderVertical":{"style":0},"locked":true,"hAlign":1,"vAlign":1,"textIndent":0,"wordWrap":false,"shrinkToFit":false,"formatter":"General","quotePrefix":false}},"4":{"value":1.0,"style":{"backColor":"Accent 5 40","font":"normal bold 9pt Arial,sans-serif","textDecoration":0,"foreColor":"Text 1 5","borderLeft":{"style":0},"borderTop":{"style":0},"borderRight":{"style":0},"borderBottom":{"style":0},"borderHorizontal":{"style":0},"borderVertical":{"style":0},"locked":true,"hAlign":1,"vAlign":1,"textIndent":0,"wordWrap":false,"shrinkToFit":false,"formatter":"0.00%","quotePrefix":false}}}}
回复 使用道具 举报
ann悬赏达人认证
初级会员   /  发表于:2022-7-5 16:20:34
3#
您好,请问这个json文件是怎么生成的呢?SpreadsJs么
回复 使用道具 举报
Lynn.Dou讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2022-7-5 17:46:22
4#
您好,
“json是其他excel区域toJson生成的。”
您是使用的GcExcel 区域toJson方法生成的该json数据吗?是否是对同一个工作簿进行的导入导出操作呢?
综上,请提供下workbook导入的ssjson文件,以及执行toJson方法的相关代码。
这边尝试复现下此问题。
附件的demo模板,您可以在模板上添加相关代码,需要可复现您描述的问题,以便这边进一步调研原因。

GcExcel_demo_maven.zip

8.44 KB, 下载次数: 673

回复 使用道具 举报
10E32
注册会员   /  发表于:2022-7-5 19:56:54
5#
Lynn.Dou 发表于 2022-7-5 17:46
您好,
“json是其他excel区域toJson生成的。”
您是使用的GcExcel 区域toJson方法生成的该json数据吗? ...

请看一下,是不是我的操作不对
回复 使用道具 举报
10E32
注册会员   /  发表于:2022-7-5 20:01:52
6#
Lynn.Dou 发表于 2022-7-5 17:46
您好,
“json是其他excel区域toJson生成的。”
您是使用的GcExcel 区域toJson方法生成的该json数据吗? ...

文件 GcExcel_demo_maven.zip (27.48 KB, 下载次数: 632)
回复 使用道具 举报
10E32
注册会员   /  发表于:2022-7-6 13:51:33
7#
ann 发表于 2022-7-5 16:20
您好,请问这个json文件是怎么生成的呢?SpreadsJs么

gcexcel自己生成的,我在下面复现了问题
回复 使用道具 举报
Lynn.Dou讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2022-7-6 17:13:34
8#
通过您提供的demo已复现此问题,已将此问题记录下来进一步调研,待有进展会第一时间在贴中回复您。本贴先做保留处理。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部