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

Free Support Forum - aspose.com

Problem with Data Source Java


I need to open a word file (.dotx or .docx), with a different datasouce to the original, to use as a template, using the combined fields.
I do it with this code

File st = new File(“C:\TEST\TEST03.docx”);
File st1 = new File(“C:\TEST\TEST04.docx”);
Document doc = new Document(“C:\TEST\TEST03.docx”);
nom_doc = getItem(ITEMS.nomdoc).getValue();
String url = “xxxxxxxxxxxx”;
String user = “_xxxxxx”;
String password = “xxxx”;
Connection conn;
conn = DriverManager.getConnection(url,user,password);
Statement stmt = conn.createStatement();
ResultSet rs ;

DataSet pizzaDs = new DataSet();
DataTable tvorlage = new DataTable(stmt.executeQuery(“select v_label FROM _SYSTEM.tvorlage WHERE v_nomdoc = '” + nom_doc + "’ ORDER BY v_label ASC "), “tvorlage”);
// Execute nested mail merge with regions

The file generates it to me, but it appears empty, without the option of being able to use the combined fields in the template.
What is wrong?
Thank you very much for the help.


Hi Albert,

Thanks for your inquiry. We will appreciate it if you please share your sample input,output and expected document here as well. It will help us to understand your issue exactly and address it accordingly.

Best Regards,

Hi Tilal

Thank you very much for the reply
Both documents (destination and source) are two blank docx documents.
I add them in copy

Thanks again.


HI Tilal

In case it helps, I send you a screen of what should be the final result when opening the target document.

Thank you !!

Hi Albert,

Thanks for sharing your sample documents. Unfortunately, we are unable to understand your requirements. Your source document(Template) is blank, you can use either mail merge fields or plain text marker for mail merge operation. We will appreciate it if you please share more details about your workflow and requirements, so we will guide you accordingly.

We are sorry for the inconvenience.

Best Regards,