Hi there,
I'm evaluating the Java version of Aspose.Words. I primarily want to use it to perform a server-side mail merge. The problem I have is that the only documented methods that I can see on the Java version of the MailMerge class are:
execute(java.sql.ResultSet resultSet)
execute(java.lang.String[] fieldNames, java.lang.Object[] values)
My server-side objects are proper Java classes e.g. a java.util.List of my own Customer objects. How can I get the MailMerge object to take my list of Customer objects and iterate over it, calling e.g. customer.getFirstName() for the firstName field in the document to be merged?
I don't want to implement the ResultSet interface to do this so that only leaves the second method. But it's not documented. I know it works if I pass in single string arrays for fields and values e.g.
MailMerge mm = wordDoc.getMailMerge();
String[] fields = new String[]{"Firstname"};
String[] values = new String[]{"Kevin"};
mm.execute(fields, values);
but can it be used with multiple values to somehow get around my problem?
Thanks for any help,
Kevin.