vfremaux / moodle-report_trainingsessions

A structured report of use time using use_stats bloc time compliatons.
6 stars 3 forks source link

Exception - Class 'PHPExcel_Style_NumberFormat' not found #19

Open papsoft opened 3 years ago

papsoft commented 3 years ago

Hello, i work with moodle 3.9 and install moodle-report_trainingsessions-MOODLE_38_WORKING.

When i press the button to generate xls report, i have the error: Exception - Class 'PHPExcel_Style_NumberFormat' not found

Can i solve the problem ?

cperves commented 3 years ago

so am i

vfremaux commented 3 years ago

Hi Céline, bises.

Actually there is a strong perturbation of the way Moodle integrated the excellib from 3.9 and ahead. We have just addressed the solution by shifting a wrapper to the new PhpOffice\PhpSpreadsheet namespace

We are validating the fix with our customers and will publish soon the result.

Hold on !

cperves commented 3 years ago

I tried this solution of replacing all the PHPEXcel occurence by PhpOffice\PhpSpreadsheet equivalent and it works well Thanks All your best Bises Céline

papsoft commented 3 years ago

I tried this solution of replacing all the PHPEXcel occurence by PhpOffice\PhpSpreadsheet equivalent and it works well Thanks All your best Bises Céline

can you help me how to do it, thanks in advance

cperves commented 3 years ago

As a matter of fact you can use lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Migrator.php all equivalences are given in this

ypu cna use it by running something like this

#!/usr/bin/env php
<?php
use PhpOffice\PhpSpreadsheet\Helper\Migrator;

$migrator = new Migrator();
$migrator->migrate();

remove some requirements in the changed file excellib.class.php in __contruct And it should work