






















场景,导出word xml时,数字都带有逗号(实际情况要去掉)
如图:

修改,需要如下红色代码设置下
private void generateWordDocument(Map<String, Object> rootMap, OutputStream out) throws Exception {
String filePath = XhxhzjmQzController.class.getClassLoader().getResource("/").getPath()
+ File.separator + "template" + File.separator + "xhxhzjmqz"; Configuration cfg = new Configuration(Configuration.VERSION_2_3_22);
cfg.setDefaultEncoding("UTF-8");
cfg.setDirectoryForTemplateLoading(new File(filePath));
cfg.setNumberFormat("#");
Template temp = cfg.getTemplate("xhbgyl.ftl", "utf-8");
try (Writer writer = new OutputStreamWriter(out, "UTF-8")) {
temp.process(rootMap, writer);
}
}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。