We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Table mailmerge - Aspose.Words (java)

I’ve seen the table mailmerge examples in C# and VB (using the DataTable object – see example below), but would like to do something similar with Aspose.Words (Java). There does not seem to be a similarly ‘generic’ approach with Java – it seems we either have to write new classes or get the data into a ResultSet (the simplest approach we are using writes the data to a database and reads it back).

Is there anything comparable to this C# for Java:

// This example creates a table, but you would normally load table from a database. 
DataTable table = new DataTable("Test");
table.Rows.Add(new object[] {"Thomas Hardy", "120 Hanover Sq., London"});
table.Rows.Add(new object[] {"Paolo Accorti", "Via Monte Bianco 34, Torino"});

// Field values from the table are inserted into the mail merge fields found in the document.

Thanks for your request. Unfortunately there is no simple analog of DataTable in java. So you should use ResultSet or IMailMergeDatasource. See the following links for more information:


Hope this helps.
Best regards.