When using the free version we build a solution that extracted data from a .json file and we could merge that data into our Word-template.
- Code: Select all
com.jayway.jsonpath.JsonPath jsonPath = com.jayway.jsonpath.JsonPath.compile(mergeField.getFieldName());
List<Map<String, Object>> dataMap = documentContext.read(jsonPath);
MailMergeDataTable mailMergeDataTable = new MailMergeDataTable(mergeField.getFieldName(), dataMap);
try {
targetDocument.getMailMerge().executeGroup(mailMergeDataTable);
} catch (Exception e) {
// just ignore;
}
After upgrade to the 12.9.0, the exact same code throws an exception. See below.
I think it has to do with the fact that the Map cannot be handled correctly. This because by executing the code using a List of 'classes', it works as expected. However, we are building a generic solution, so we don't know which 'class' is to be merged. And in the free-version it worked perfectly. I was expecting to use exactly the same code after buying a license.
We are moving from a Proof-of-Concept to Production phase. So it is important to have this fixed quickly.
- Code: Select all
java.lang.NullPointerException: Cannot invoke "com.spire.doc.packages.sprztp.spr⌨§(int)" because "this.spr—" is null
at com.spire.doc.packages.sprhay.spr┽’(Unknown Source)
at com.spire.doc.reporting.MailMerge.spr┽▒(Unknown Source)
at com.spire.doc.reporting.MailMerge.spr㈮⃞▔(Unknown Source)
at com.spire.doc.reporting.MailMerge.spr┾▓(Unknown Source)
at com.spire.doc.reporting.MailMerge.spr┱▔(Unknown Source)
at com.spire.doc.reporting.MailMerge.spr▒▔(Unknown Source)
at com.spire.doc.reporting.MailMerge.spr⁆▔(Unknown Source)
at com.spire.doc.reporting.MailMerge.spr┋▒(Unknown Source)
at com.spire.doc.packages.spracs.spr╻▒(Unknown Source)
at com.spire.doc.packages.sprctr.spr㈫⃡▒(Unknown Source)
at com.spire.doc.packages.sprctr.spr⅝▒(Unknown Source)
at com.spire.doc.packages.sprctr.spr┛▒(Unknown Source)
at com.spire.doc.packages.sprctr.spr⅝▒(Unknown Source)
at com.spire.doc.packages.sprctr.spr●▒(Unknown Source)
at com.spire.doc.reporting.MailMerge.spr⅔▓(Unknown Source)
at com.spire.doc.reporting.MailMerge.spr┤▔(Unknown Source)
at com.spire.doc.reporting.MailMerge.executeGroup(Unknown Source)