Details

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

      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

        Gliffy Diagrams

          Issue Links

            Activity

            salvetore Michael de Raadt created issue -
            aborrow Anthony Borrow made changes -
            Field Original Value New Value
            Link This issue duplicates MDL-28069 [ MDL-28069 ]
            Hide
            salvetore 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
            salvetore 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
            salvetore Michael de Raadt made changes -
            Attachment grep for excel in codebase.txt [ 24218 ]
            salvetore Michael de Raadt made changes -
            Link This issue has a non-specific relationship to MDL-19864 [ MDL-19864 ]
            salvetore Michael de Raadt made changes -
            Link This issue has a non-specific relationship to MDLQA-964 [ MDLQA-964 ]
            salvetore Michael de Raadt made changes -
            Fix Version/s STABLE backlog [ 10463 ]
            Priority Minor [ 4 ] Major [ 3 ]
            Labels triaged
            Assignee moodle.com [ moodle.com ] Michael de Raadt [ salvetore ]
            Hide
            stronk7 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
            stronk7 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
            salvetore 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
            salvetore 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?
            salvetore Michael de Raadt made changes -
            Link This issue has been marked as being related by MDL-28572 [ MDL-28572 ]
            salvetore Michael de Raadt made changes -
            Link This issue has been marked as being related by MDL-32145 [ MDL-32145 ]
            Hide
            sbourget Stephen Bourget added a comment -

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

            Show
            sbourget Stephen Bourget added a comment - have you looked at PHPExcel as a possible replacement? ( https://github.com/PHPOffice/PHPExcel )
            Hide
            jmvedrine 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
            jmvedrine 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
            salvetore 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
            salvetore 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.
            salvetore Michael de Raadt made changes -
            Status Open [ 1 ] Closed [ 6 ]
            Fix Version/s STABLE backlog [ 10463 ]
            Resolution Fixed [ 1 ]
            salvetore Michael de Raadt made changes -
            Link This issue has a non-specific relationship to MDL-35356 [ MDL-35356 ]

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: