Hi,
I was trying out mail merge via XML using the classes you provide on GitHub.
I am attaching my test template, the test XML, and the mail merge classes as I have modified those a little bit.
My test setup code goes as follows:
Document doc = new Document("/path/to/header_sgi_it.doc");
doc.getMailMerge().setCleanupOptions(
// rimozione regioni non compilate
MailMergeCleanupOptions.REMOVE_UNUSED_REGIONS
// rimozione campi non compilati
| MailMergeCleanupOptions.REMOVE_UNUSED_FIELDS
// rimozione campi innestati
| MailMergeCleanupOptions.REMOVE_CONTAINING_FIELDS
);
Now, if I do
IMailMergeDataSource data = new DataTable("content of test.xml")
doc.getMailMerge().execute(data);
and then save the document as PDF, I get a totally empty PDF; if instead I do
IMailMergeDataSourceRoot data = new DataSet("content of test.xml");
doc.getMailMerge().setMergeDuplicateRegions(true);
doc.getMailMerge().executeWithRegions(data);
and again save as PDF, the region is merged, but not the fields outside any region.
What am I doing wrong?
Thanks.