I have a requirement to use mailmerge to produce a document that contains customer data including a list of related “alerts”. This data is in the form of business objects, pojo’s.
So I have a Customer object with e.g. String variables of name, address and a typed List of Alert objects. I have made a class extending IMailMergeDataSource that handles in its “getValue()” requests for fieldName of “name”, “Address” and “alerts”, setting the appropriate result into fieldValue.
I have a template document with MailMerge field names for “name” and “address” and a TableStart:alerts and TableEnd:alerts inside a table row.
When I execute getMailMerge().execute() I get all the static fields fine - e.g. name and address - but the alerts table doesn’t get processed. When I execute getMailMerge().executeWithRegions I get nothing. None of the static fields and none of the Table fields are processed.
How should I be setting this up? I’m going in circles…
Thanks in advance