by Izertis

Create documents in docx, xlsx (MS Office Word and Excel), odt, ods (LibreOffice and OpenOffice) and pdf format without MS Office or others plugins installed from any module and subpanel using templates.

Includes a 30 day guarantee
Try it Now

By clicking you consent to be contacted by the developer

#2221 - Corrupt Word-Files on Download

Closed General Question created by office3 5 years ago

Hi,

we found a very strange problem. Recently when generating a Wordfile and downloading it, the file is corrupted. Word tries to fix the file(which will work). When sending the exact same document via email, the document ist fine.

Actually this problem did not come to us at ones, but took some time. After trying several documents (old and also new test-templates) some were fine and some were corrupt. But now no document works when downloaded. The templates itself CAN be downloaded and will open just fine in Word. It seems that only a couple of bits, some at the file-header, some at the file-end are changed, when comparing to the working email-send version.

Thanks in advance for your help!

  1. dharma member avatar

    Izertis Provider

    5 years ago

    Hi there,

    We apologize to be so late to answer you. Could you send us the template that has problems?

    Regards,

    Anabel

  2. josh2 member avatar

    josh2

    4 years ago

    Any progress on this bug? I am having the same issue. Is this some sort of character encoding issue? Or some sort other formatting error in word?

    For me, this issue seems to be causing mail merge from the ListView to work incorrectly. We are able to Mail Merge other documents just fine.

    This document can be mail merged from the detailview and listview if using just one document. But If I select 10 documents and try to mail merge, it seems to select a random number of them and will not do all of them.

  3. josh2 member avatar

    josh2

    4 years ago

    Any progress on this bug? I am having the same issue. Is this some sort of character encoding issue? Or some sort other formatting error in word?

    For me, this issue seems to be causing mail merge from the ListView to work incorrectly. We are able to Mail Merge other documents just fine.

    This document can be mail merged from the detailview and listview if using just one document. But If I select 10 documents and try to mail merge, it seems to select a random number of them and will not do all of them.

  4. josh2 member avatar

    josh2

    4 years ago

    I was able to fix this problem after I converted it to a .xml file and saw php warnings at the top of the xml.

    Then I checked my code in custom/[your_module]/DHA_DocumentTemplatesCalculatedFields.php and realized I had accidentally set:

    ini_set('display_errors', 1);

    So make sure your php.ini file as well as your code is not displaying php warnings or they will be outputed to the word document.

    • dharma member avatar

      Izertis Provider

      4 years ago

      Hi Josh,

      We will investigate in the next version of the component if the display_errors parameter can be temporarily deactivated during the generation of the document, in case it is activated. Anyway, SugarCRM recommends disabling that parameter to avoid distractions to users. See http://support.sugarcrm.com/Knowledge_Base/Troubleshooting/About_PHP_Notices_Warnings_and_Errors/index.html

      Regards

This case is public. Please leave out any sensitive information such as URLs, passwords, etc.
Saving Comment Saving Comment...
Rating