• Resolved calester

    (@calester)


    Apologies in advance if this has already been answered in a different thread.

    I am trying to export data as XLS and CSV from my WP page using WP Statistics V9.5.3 and am unable to open the data file when exported in either XLS or CSV.

    For excel, I export in chrome and then when I open I receive the following message:
    “The file format and extension of ‘wp-statistics-2015-08-25-14-13.xls’ don’t match. The file could be corrupted or unsafe. Unless you trust the source, don’t open it. Do you want to open it anyway?”

    Based on the WP Statistics manual I expected this to happen and hit “Yes” but excel then responds that “The file is corrupt and cannot be opened.”

    Am I doing something wrong? Any guidance/clarification on the correct export process and/or workarounds is greatly appreciated.

    Alternately, when I download and open the CSC file the data table is empty.

    Any help/fixes for either file type is much appreciated.

    Thanks in advance.

    https://wordpress.org/plugins/wp-statistics/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi – I’m getting the same error with xls export. CSV format exports report ‘The file is empty’. I’m using WordPress 4.3 and WP Statistics 9.5.3. Any ideas please?

    Plugin Contributor Greg Ross

    (@gregross)

    For the Excel issue, my recommendation is to do a CSV export only and then open that in Excel.

    I’ve been meaning to remove the “Excel” option as all it does is output a csv file with the xls extension. That used to work in older version of Excel but newer ones throw the error and don’t open the file.

    For the empty export issue, it’s a bug in 9.5.3, I’ll fix it in the next release.

    In the mean time if you want to fix it yourself, edit the wp-content/plugins/statistics/includes/functions/export.php file, line 53 should be:

    if( count( $result < 1 ) ) { echo "No data in table!"; exit; }

    change it to:

    if( count( $result ) < 1 ) { echo "No data in table!"; exit; }

    Great! That did it – thanks.

    Plugin Contributor Greg Ross

    (@gregross)

    Good to hear.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Corrupted Excel File Output’ is closed to new replies.