XDocReport generated docx document not opening

723 views Asked by At

I am trying to generate a Office 2010 docx document using XDocReport library. I am printing images in a list with RemoveImageTemplate behavior. The problem is the file opens properly if i provide all the images. And says file is corrupt if any of the image missing. However i can open the properly if using KeepImageTemplate behavior.

Using ODT templates works as expected with RemoveImageTemplate behavior.

I am using XDocReport 1.0.3 with Office 2010. Any help is appreciated.

1

There are 1 answers

0
Angelo On BEST ANSWER

When you create a "template image" in a docx for XDocReport, you must insert a bookmark inside the image. For instance if your image is inserted in a table cell, your bookmark must be inserted inside the image and not inside the table cell, otherwise the generated docx will not be valid.

It think it's your problem, see at https://code.google.com/p/xdocreport/issues/detail?id=340#c7 for more information.