Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Doeke Norg

    (@doekenorg)

    Hmm.. this usually happens when the site also throws notices and things that change the content of the file just a little bit.

    Can you try to disable your WP_DEBUG setting if active?

    Please let me know if that works.

    Thread Starter snap-shot

    (@snap-shot)

    Hi Doeke,

    thank you for the tip, I did check and the settings in my wp-config are off as I show you following:

    define( ‘WP_DEBUG’, false );
    // Enable Debug logging to the /wp-content/debug.log file
    define( ‘WP_DEBUG_LOG’, false );
    // Disable display of errors and warnings
    define( ‘WP_DEBUG_DISPLAY’, false );
    //@ini_set( ‘display_errors’, 0 );
    // conserva 3 revisioni per i post
    define( ‘WP_POST_REVISIONS’, 3 );


    Perhaps this is not “blocking” me because it is working using CSV format, but I would prefer to have the xls output because I have a “special” client who is technically incapable of converting csv to xls! Glad me!

    If you have any other tip, otherwise I’ll try to keep it as it is.
    BR

    Plugin Author Doeke Norg

    (@doekenorg)

    I’ll get back to you on this. Going to try and reproduce. Will let you know!

    Plugin Author Doeke Norg

    (@doekenorg)

    Hi @snap-shot,

    I did some digging, and I possibly already have a fix for this in place for the next release (a pull request on the github page :-)).

    Could you edit the AbstractPHPExcelRenderer.php file, and add
    ob_end_clean(); before: $objWriter->save('php://output');

    So it would then read:

    // ...
    header('Pragma: public'); // HTTP/1.0
    ob_end_clean();
    $objWriter->save('php://output');

    This should prevent all other content from screwing up the excel file.

    Please let me know if this works. If so, I will definitely be mergining that pull request ??

    Thread Starter snap-shot

    (@snap-shot)

    Thanks Doeke, tryed that but nope!

    Now I am not able to open the xlsx file at all, nor with Excel/LIbreoffice or Google Drive

    Plugin Author Doeke Norg

    (@doekenorg)

    Can you send me both files? You can mail them to [email protected]. maybe I can figure out something more.

    Thanks.

    Plugin Author Doeke Norg

    (@doekenorg)

    I’ve been investigating this error, and @snap-shot was kind enough to send me the broken file. It seems there is some whitespace attached at the beginning of the file, and this is (most likely) being caused by a .php-file that has whitespace before <?php or has a closing tag ?> and then some whitespace.

    As a rule, .php files should never end with a closing tag ?> to prevent exactly this problem. While the next release will be better equipped to handle this error, it cannot prevent this exact use-case.

    Hope this helps anyone out there, and @snap-shot in particular!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Download link produces a broken xls file’ is closed to new replies.