Hi,
I am using Aspose word version 16.7.0
My issue is after mailmerge , the placeholders inside dataTable leaves empty line if there is no data for it. For example:
«TableStart:person»
«NAME»
«ADDRESSLINE1»
«ADDRESSLINE2»
«CITY», «STATE» «ZIP_CODE»«ZIP_CODE_EXT»
«TableEnd:person»
gets mailmerged PDF as
John Doe
1100 Laxinton St
Denver,IA 95666
There is a noticeable line break in the place of ADDRESSLINE2 when it has no data.
My code looks something like this:
DataSet ds = new DataSet();
ds.readXml(getXml));
doc.getMailMerge().setFieldMergingCallback((IFieldMergingCallback) new HandleMergeField());
doc.getMailMerge().setCleanupOptions(MailMergeCleanupOptions.REMOVE_UNUSED_REGIONS
| MailMergeCleanupOptions.REMOVE_CONTAINING_FIELDS
| MailMergeCleanupOptions.REMOVE_STATIC_FIELDS
| MailMergeCleanupOptions.REMOVE_UNUSED_FIELDS
| MailMergeCleanupOptions.REMOVE_EMPTY_PARAGRAPHS);
doc.getMailMerge().execute(ds.getTables().get("Order")); // this is for another order section
doc.getMailMerge().executeWithRegions(ds);
doc.save(getMergedWordFilePath());
Please suggest , how to get rid of the empty line left.
Thanks