您好,我当前使用的Aspose-word版本是23.6,在使用ReportingEngine引擎给列表前加递增的序号时,没有生效,请问该如何修改?
LoadOptions opt = new LoadOptions();
opt.getLanguagePreferences().setDefaultEditingLanguage(EditingLanguage.CHINESE_PRC);
// 将输入流转为doc
Document doc = new Document(inputStream, opt);
ReportingEngine engine = new ReportingEngine();
ContractDto contractDto = this.buildContractDto();
OrderDto orderDto = this.buildOrderDto();
List<Rule> ruleList = this.buildRuleList();
Object[] objects = { contractDto, orderDto, ruleList };
String[] dataSourceNames = { "contractDto", "orderDto", "ruleList" };
// 声明对象类型,在foreach中会用到
engine.getKnownTypes().add(Rule.class);
// 将数据填充至模板
engine.buildReport(doc, objects, dataSourceNames);
// 转pdf
doc.save(outputStream, SaveFormat.PDF);
word中的标签
1. <<foreach [Rule item in ruleList]>><<[item.getRuleName()]>><</foreach>>
生成的pdf