Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.3
    • Fix Version/s: None
    • Component/s: Libraries
    • Labels:
    • Rank:
      17694

      Description

      We are currently using the Excel writer package to export data to XLS format.

      The code for this is currently in two locations:

      • lib/excel
      • lib/pear/Spreadsheet/Excel

      The Excel writer is producing output that is either mal-formed or missing data and often will not open or import into applications.

      According to the authors of the package at http://pear.php.net/package/Spreadsheet_Excel_Writer...

      Spreadsheet_Excel_Writer is outdated and needs a complete rewrite. If you want to help with this task please get in touch with us. Otherwise we don't recommend this package for new development.

      Things that need to happen:

      1. The places where this code is used needs to be reviewed.
      2. An alternative library needs to be found or created

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Comment from Anthony...

          After some problems with creating database activity module exports (see MDLQA-964 and MDL-19864 for details), it appears that there are various places where we have Excel related code. It would probably be a good idea to go in and remove any duplication and settle on a single approach that seems reasonably reliable. Here is what I found so far:

          lib/pear/Spreadsheet/Excel
          lib/excellib.class.php
          lib/excel/*

          Some questions that came up in discussions:
          1) Are the libraries current (updated)
          2) Are there other libraries now that produce more recent versions of Excel (Biff8 is essentially Excel 5 - prior to 2007, etc.)
          3) are we using one single library/approach to creating the Excel files?
          4) should we continue to support xls format

          I wonder if there is a way to create the Open Office Calc file (or a CSV) and then simply have that converted to an xls file.

          There may be other issues as well but I figured this would be a good place to start a conversation. I'm attaching a grep of the code base for any file containing the word excel.

          Peace - Anthony

          Show
          Michael de Raadt added a comment - Comment from Anthony... After some problems with creating database activity module exports (see MDLQA-964 and MDL-19864 for details), it appears that there are various places where we have Excel related code. It would probably be a good idea to go in and remove any duplication and settle on a single approach that seems reasonably reliable. Here is what I found so far: lib/pear/Spreadsheet/Excel lib/excellib.class.php lib/excel/* Some questions that came up in discussions: 1) Are the libraries current (updated) 2) Are there other libraries now that produce more recent versions of Excel (Biff8 is essentially Excel 5 - prior to 2007, etc.) 3) are we using one single library/approach to creating the Excel files? 4) should we continue to support xls format I wonder if there is a way to create the Open Office Calc file (or a CSV) and then simply have that converted to an xls file. There may be other issues as well but I figured this would be a good place to start a conversation. I'm attaching a grep of the code base for any file containing the word excel. Peace - Anthony
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Personal comment:

          I've spent dozen of hours investigating / trying to improve the horrible excel export. Changed of version, switched to experimental BIFFs, improve support for UTF-8... so I'm positioned about:

          1) Quick test if there is some alternative (or upgrade) passing a complete battery of unittests
          2) If found, use it
          3) Else, drop excel support once and forever. Offer CSV and OO instead always.

          Just based in my experience with this, FYC, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Personal comment: I've spent dozen of hours investigating / trying to improve the horrible excel export. Changed of version, switched to experimental BIFFs, improve support for UTF-8... so I'm positioned about: 1) Quick test if there is some alternative (or upgrade) passing a complete battery of unittests 2) If found, use it 3) Else, drop excel support once and forever. Offer CSV and OO instead always. Just based in my experience with this, FYC, ciao
          Hide
          Michael de Raadt added a comment -

          I thought I should record a comment from Andrew during a discussion this morning.

          I suggested that if we remove the Excel option, then Excel users will think they don't have a format they can open, even though the CSV option will work for them.

          His suggestion is that we just title the option "Spreadsheet" and give them a CSV file. This would work and keep naive users happy.

          The only time it might not work is if we are exporting more that static values. Are we ever exporting formulae?

          Show
          Michael de Raadt added a comment - I thought I should record a comment from Andrew during a discussion this morning. I suggested that if we remove the Excel option, then Excel users will think they don't have a format they can open, even though the CSV option will work for them. His suggestion is that we just title the option "Spreadsheet" and give them a CSV file. This would work and keep naive users happy. The only time it might not work is if we are exporting more that static values. Are we ever exporting formulae?
          Hide
          Stephen Bourget added a comment -

          have you looked at PHPExcel as a possible replacement? (https://github.com/PHPOffice/PHPExcel)

          Show
          Stephen Bourget added a comment - have you looked at PHPExcel as a possible replacement? ( https://github.com/PHPOffice/PHPExcel )
          Hide
          Jean-Michel Vedrine added a comment - - edited

          May I second Stephen advice : on another project I was using pear Excel library for spreadsheet writing. As I needed reading too, I switched to PHPExcel a few months ago. I find it powerfull and reliable.
          I must note that licence is LGPL, don't know if this is a problem for Moodle inclusion or not ?

          Show
          Jean-Michel Vedrine added a comment - - edited May I second Stephen advice : on another project I was using pear Excel library for spreadsheet writing. As I needed reading too, I switched to PHPExcel a few months ago. I find it powerfull and reliable. I must note that licence is LGPL, don't know if this is a problem for Moodle inclusion or not ?
          Hide
          Michael de Raadt added a comment -

          I didn't come across PHPExcel when I went looking last. It looks solid. I will create a separate issue to transition to that library and close this issue.

          Show
          Michael de Raadt added a comment - I didn't come across PHPExcel when I went looking last. It looks solid. I will create a separate issue to transition to that library and close this issue.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: