when I export to excel. No problem exporting to word, csv, etc… but when I try to export to excel I get the error:
[TypeError] Cannot assign null to property PHPMaker2026\Semicom2026\ExportExcel::$Format of type string in C:\laragon\www\partes26\src\ExportExcel.php:37
// PhpSpreadsheet
AddListener(ConfigurationEvent::class, function (ConfigurationEvent $event) {
$event->import([
"USE_PHPEXCEL" => true,
"EXPORT_EXCEL_FORMAT" => "Excel5", // or "Excel2007"
]);
});
You can also test the config by the following in your page:
<?= Config("EXPORT_EXCEL_FORMAT") ?>
You should see your setting set in the listener above, if you see null, you might have some other code set it to null. You better double check your server events. Note that in v2026, "EXPORT_EXCEL_FORMAT" is only set by the event listener in userfn.php. If you use any third party extension, you better remove it first.
I’ve tried too to show the values of “USE_PHPEXCEL” and “PDF_BACKEND” with the same result. So it seems the problem is in some point the value is changed.