Mailmerge ResultSet to DataTable

Hy,


I want to use a mailmerge like this

DataTable dt = new DataTable(resultSet, “staff”);
docTemplate.getMailMerge().executeWithRegions(dt);

The resultSet is correct and contains one column of ID´s formatted as integers.

The template contains the following table

«TableStart:staff»«IDs» «TableEnd:staff»<span style=“font-size:11.0pt;line-height:
115%;font-family:“Calibri”,“sans-serif”;mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:
minor-latin;mso-bidi-font-family:“Times New Roman”;mso-bidi-theme-font:minor-bidi;
mso-ansi-language:DE;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>

This mergefield is not replaced with the requested table but extended with the correct number of rows (as in the resultSet/DataTable).

Thanks for your help,
Franz

Hi Franz,


Thanks for your inquiry. I have tested the scenario and have not found the shared issue. In case you are using an older version of Aspose.Words, I would suggest you please upgrade to the latest version (v13.6.0) from here and let us know how it goes on your side. If the problem still remains, please attach your input Word document here for testing. I will investigate the issue on my side and provide you more information.