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.
Then I'm sure why it happened to your site. I cannot reproduce, the listener sets the format correctly. You may delete all files in your project folder and generate all files again to make sure everything is updated, or you may enable Debug and check the log file, see if there was any error preventing the listener from setting the "EXPORT_EXCEL_FORMAT".
Deleted all files in the project. Debug enabled. No entries for EXPORT_EXCEL_FORMAT in the log. The only excel reference is:
[2026-02-06T19:29:16.914606+00:00] deprecation.INFO: User Deprecated: Class "Doctrine\ORM\Proxy\Autoloader" is deprecated. Use native lazy objects instead. (Autoloader.php:74 called by DoctrineBundle.php:136, https://github.com/doctrine/orm/pull/12005, package doctrine/orm)
{"exception":"[object] (ErrorException(code: 0): User Deprecated: Class \"Doctrine\\ORM\\Proxy\\Autoloader\" is deprecated. Use native lazy objects instead. (Autoloader.php:74 called by DoctrineBundle.php:136, https://github.com/doctrine/orm/pull/12005, package doctrine/orm) at C:/laragon/www/partes26/vendor/doctrine/deprecations/src/Deprecation.php:208)"}
[2026-02-06T19:29:16.984268+00:00] request.INFO: Matched route "api.export".
{"route":"api.export","route_parameters":{"_route":"api.export","table":"partes_jdo","key":null,"_controller":"PHPMaker2026\\Semicom2026\\ApiController::export","param":"excel"},"request_uri":"http://partes26.test/api/export/excel/partes_jdo","method":"GET"}
Those are irrelevant. Don't know how you deleted cache before, but you better delete var\cache\dev and/or var\cache\prod (make sure you delete correct cache for your dev/prod environment) manually and try again. If you have already uploaded to your production server, make sure you delete cache on the server, not just on your PC.