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

Free Support Forum - aspose.com

LibreOffice Merge fields

Hi,

i was trying to build a template for mail merge using Libre Office.
I used a database merge field, but during mail merge to pdf the format a specified on the filed was not honered. Does it work only with MSWord ?
thanks.

Hi Simone,

Thanks for your inquiry. Could you please attach your input document here for testing? I will investigate the issue on my side and provide you more information.

Here you are, thanks.

Hi Simone,

Thanks for sharing the document.
Perhaps, you are using an older version of Aspose.Words; as with Aspose.Words v14.7.0, I am unable to reproduce this problem on my side. I have used the following code example to test this issue.

I would suggest you please upgrade to the latest version of Aspose.Words i.e. v14.7.0 and let us know how it goes on your side. I hope, this will help.

Document doc = new Document(MyDir + "test.odt");
DataTable dt = new DataTable("Model");
dt.getColumns().add("numero");
dt.getColumns().add("oggettoIT");
dt.getColumns().add("oggettoDE");
dt.getRows().add("numero", "oggettoIT", "oggettoIT");
dt.getRows().add("numero", "oggettoIT", "oggettoIT");
DataTable dt2 = new DataTable("Elementi");
dt2.getColumns().add("nome");
dt2.getColumns().add("importo");
dt2.getRows().add("nome", "importo");
dt2.getRows().add("nome", "importo");
DataSet ds = new DataSet();
ds.getTables().add(dt);
ds.getTables().add(dt2);
doc.getMailMerge().setUseNonMergeFields(true);
doc.getMailMerge().executeWithRegions(ds);
doc.save(MyDir + "Out.pdf");

Hi Tahis,
I’m already using the last version of Aspose Words.

If you try to replace this lines of your code:

dt2.getRows().add("nome", "importo");
dt2.getRows().add("nome", "importo");

with those:

dt2.getRows().add("nome", "12");
dt2.getRows().add("nome", "12");

you will realize that the field “importo” will not be replaced with “12” in the resulting pdf…
Thanks

Hi Simone,

Thanks for your inquiry. Perhaps, you are using an older version of Aspose.Words; as with Aspose.Words v14.7.0, I am unable to reproduce this problem on my side. I would suggest you please upgrade to the latest version of Aspose.Words i.e. v14.7.0 and let us know how it goes on your side. I hope, this will help. I have attached the output Pdf with this post for your kind reference.

i am already using v 14.7.0 (trial)

Hi Simone,

Thanks for your feedback. Could you please save your final document to Docx and Pdf and share the output documents here for our reference? Please also share following detail for further investigations.

What environment are you running on?

  • OS (Windows Version or Linux Version)
  • Architecture (32 / 64 bit)
  • Java version

Windows 7
64 bit
JDK 1.7
Thanks

Hi Simone,

Thanks for sharing the detail. I have tested the scenario at Windows 7 (64 bit), JDK 1.7 and have not found the shared issue. Please make sure that you are using the same document (test.odt). I have attached the output document with this post for your kind reference.

You’re right…it works…
I was using an old copy of the odt file. Thank you very much for the time you spent on this issue and for the patience.

Simone

Hi Simone,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.