Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed Oct 12, 2022 7:03 am

Hello, as mentioned in the title
I am using mailmerge using xml, but if the table contents are long, the page does not change and continues from one page. I want to know how to solve it.
I will leave the file before and after the change. thank you

This is the code for adding the xml file.

Code: Select all
String tmpFilePath = path+File.separator+new Date().getTime()+"_tmp.xml";
            log.info("tmp File path ::: {}", tmpFilePath);
           
            DOMSource source = new DOMSource(xmlDoc);
            File tmpFile = new File(tmpFilePath);
            StreamResult result = new StreamResult(new FileOutputStream(tmpFile));
 
            transformer.transform(source, result);
           
            if(tmpFile.exists()){ //tmp 파일 확인후 제거함
                try {
                 
                   //xml파일로 mailMerge 데이터 처리
                  doc.getMailMerge().executeWidthRegion(tmpFilePath);

                  if(tmpFile.delete()) log.info("tmp File delete success ::: {}",tmpFilePath);
                  
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }

crizen.solution
 
Posts: 14
Joined: Mon May 30, 2022 12:47 am

Wed Oct 12, 2022 9:56 am

Hello,

Thanks for your inquiry.
According to the documents you provided and your description, after I changed the text wrapping parameter of the table to none(as shown in the screenshot1 belows ) in the “after.docx” document , the issue you mentioned is disappear. So I recommend that you can set text wrapping parameter of the table to “none”in the “before.docx” document, then use mailmerage function.
If the issue still exists, please offer the following message, thanks for your assistance in advance.
1) The xml file.
2) The Jdk version, such as Oracle Jdk1.8.
3) Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Thu Oct 13, 2022 1:21 am

thank you The problem was well resolved.

crizen.solution
 
Posts: 14
Joined: Mon May 30, 2022 12:47 am

Thu Oct 13, 2022 1:36 am

Hello,

Thanks for your feedback.
If you have any issue in the future, just feel free to contact us. Have a nice day! :D

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.Doc