Cannot export any view to XLS, XLSX or ODS

Created on 26 January 2023, almost 2 years ago
Updated 8 July 2023, over 1 year ago

Problem/Motivation

It looks like the views aren't exporting properly in XLS, XLSX and ODS formats. When I try to open the downloaded file, Excel shows the following error:

Excel Cannot Open the File Because the File Format or File Extension is Not Valid

You can find views_data_export_phpspreadsheet_export_fail.png attached in order to see a screenshot.
This screenshot corresponds to a XLSX export. If I export the view to XLS, I manage to open it, but it isn't displayed OK. You can see evidence in views_data_export_phpspreadsheet_export_fail_2.png

Steps to reproduce

  1. Add a Data export display in any view.
  2. In format, select Xls Export->XLS, XLSX or ODS
  3. Save view
  4. Export the view and try to open the generated file
🐛 Bug report
Status

Fixed

Version

1.5

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jlopezb
  • 🇫🇷France lazzyvn paris

    Do you see any errors in the log?
    Perhaps there is an encoding issue with your current language.
    Have you tried a different language?
    I can make sure that this module works well with French and Vietnamese as I use it daily.

  • Exactly the same issue on D7 trying to open with MS Office and LibreOffice on Linux, MacOS and Windows, so I guess it's related to the output from Drupal. I have two websites that are almost clones and on one I have this issue. Export to csv works fine but I loose some outputs for phone numbers so I'd rather use xlsx or ods files.

  • Status changed to Fixed over 1 year ago
  • 🇫🇷France lazzyvn paris

    - I think there is a php warning output in the file, so the excel file hangs
    - try version 2 a bug has been fixed, there are no more warnings in the code

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024