Hi everyone,
I have been using maatwebsite/excel to generate PDFs from data in our database. It worked great until I upgraded to PHP 7.1, now I receive the following error:
ErrorException: A non-numeric value encountered in /home/forge/cvahimt.org/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell.php:835
It is my understanding that this is an issue with phpoffice/phpexcel.
Can anyone suggest an alternative to maatwebsite/excel with good documentation?
Here is my code to give you an idea of my current needs. Data is fetched by a helper class, should not be relevant. (Sorry if the syntax highlighting isn't working, not sure why):
$entriesObj = new personnelSpreadsheetEntry($users);
\Excel::create('CVAHIMT-personnel-export-' . date("m-d-Y"),
function ($excel) use ($entriesObj) {
$excel->sheet('Personnel Listing', function ($sheet) use ($entriesObj) {
$sheet->setOrientation('landscape');
$sheet->fromArray($entriesObj->generateContactSheet());
$sheet->row(1, function ($row) {
$row->setFontWeight('bold');
$row->setBackground('#f2e296');
});
$sheet->setAutoFilter();
$sheet->setFreeze('C2');
});
$excel->sheet('Emergency Contacts', function($sheet) use ($entriesObj) {
$sheet->setOrientation('landscape');
$sheet->fromArray($entriesObj->generateEmergencyContacts());
$sheet->row(1, function ($row) {
$row->setFontWeight('bold');
$row->setBackground('#f2e296');
});
$sheet->setAutoFilter();
$sheet->setFreeze('C2');
});
$excel->getDefaultStyle()
->getAlignment()
->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$excel->setActiveSheetIndex(0);
})->export("xls");