I have a scenario here.
private static String MyDir = "src/quickstart/doc2pdf/data/";
public static void main(String[] args) throws Exception {
Document doc = new Document(MyDir + "Field.docx");
List values = new ArrayList();
// I want three value rows which should generate dynamically in the docx.
values.add("Value 1");
values.add("Value 2");
values.add("Value 3");
doc.getMailMerge().execute(
new String[] {"Demo", "Table.header", "Table.value"},
new Object[] {"James Bond", "Sample Header", values });
doc.save(MyDir + "FieldOut.docx");
}
While I run this code I got the output as attached but what I expected I am attaching as Expected.docx