KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

Trying to access array offset on value of type int {"userId":3,"exception":"[object] (ErrorException(code: 0): Trying to access array offset on value of type int at #1497

Closed paulo opened this topic on on Jun 22 - 6 comments

paulo commented on Jun 22

Hi I am receiving this error when trying to export, any idea why ?
thank you

Trying to access array offset on value of type int {"userId":3,"exception":"[object] (ErrorException(code: 0): Trying to access array offset on value of type int at /home/forge/my.ellisontravel.com/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php:58) [stacktrace] #0 /home/forge/my.ellisontravel.com/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php(58): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError() #1 /home/forge/my.ellisontravel.com/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php(36): PhpOffice\PhpSpreadsheet\Cell\DefaultValueBinder::dataTypeForValue() #2 /home/forge/my.ellisontravel.com/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php(184): PhpOffice\PhpSpreadsheet\Cell\DefaultValueBinder->bindValue() #3 /home/forge/my.ellisontravel.com/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php(1126): PhpOffice\PhpSpreadsheet\Cell\Cell->setValue() #4 /home/forge/my.ellisontravel.com/vendor/koolreport/excel/Table.php(180): PhpOffice\PhpSpreadsheet\Worksheet\Worksheet->setCellValue() #5 /home/forge/my.ellisontravel.com/vendor/koolreport/excel/Table.php(32): koolreport\excel\Table::saveDataStoreToSheet() #6 /home/forge/my.ellisontravel.com/vendor/koolreport/excel/ExportHandler.php(260): koolreport\excel\Table::saveContentToSheet() #7 /home/forge/my.ellisontravel.com/vendor/koolreport/excel/ExcelExportable.php(39): koolreport\excel\ExportHandler->exportToExcel() #8 /home/forge/my.ellisontravel.com/app/Http/Controllers/Admin/AdminReportController.php(1081): App\Reports\AirGroup\LegacyAirGroup->exportToExcel() #9 [internal function]: App\Http\Controllers\Admin\AdminReportController->executeReport() #10 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array() #11 /home/forge/my.ellisontravel.com/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction()

David Winterburn commented on Jun 23

Hi,

Is your PHP version 7.4? Please also let us know your Excel package version. Thanks!

paulo commented on Jun 23

yes, PHP version 7.4 I use composer update --lock --no-dev --with-dependencies so I am assuming whatever it is listed under the koolrepository is updating my system.
"koolreport/excel": "*",

Under my folder Vendor (Laravel), koolreport/excel/composer.json I have the version after name "6.0.0"

and the version after require phpoffice/phpspreadsheet: ^1.6

is this what you were looking for ? thank you

David Winterburn commented on Jun 24

Hi Paulo,

Your error is a problem of phpoffice/phpspreadsheet version prior to 1.10 with PHP 7.4. The author has fixed it since then. So to solve this issue please update your Excel package to a 7.x version (7.0.0, 7.1.0, 7.2.0). I would suggest using composer require like:

    "koolreport/excel": "^7.2",

Please try it and let us know the result. Thanks!

paulo commented on Jun 24

thank you. When I try with 7.2 I get several errors , see further below. I left with "koolreport/excel": "*", it says it is on version 7.1.1 so I hope it will resolve the issue once I deploy. Do you have any other suggestion ? thanks

Errors: Your requirements could not be resolved to an installable set of packages.

Problem 1

- The requested package koolreport/excel ^7.2 exists as koolreport/excel[7.1.1, 1.0.0, 2.0.0, 2.1.0, 3.0.0, 5.0.0, 6.0.0, 7.0.0,

7.1.0] but these are rejected by your constraint. Problem 2

- The requested package koolreport/excel (locked at 7.1.1, required as ^7.2) is satisfiable by koolreport/excel[7.1.1] but these

conflict with your requirements or minimum-stability. Problem 3

- koolreport/pro 4.5.1 requires koolreport/excel 7.1.1 -> satisfiable by koolreport/excel[7.1.1] but these conflict with your re

quirements or minimum-stability.

- koolreport/pro 4.5.1 requires koolreport/excel 7.1.1 -> satisfiable by koolreport/excel[7.1.1] but these conflict with your re

quirements or minimum-stability.

- koolreport/pro 4.5.1 requires koolreport/excel 7.1.1 -> satisfiable by koolreport/excel[7.1.1] but these conflict with your re

quirements or minimum-stability.

- Installation request for koolreport/pro (locked at 4.5.1, required as *) -> satisfiable by koolreport/pro[4.5.1].
David Winterburn commented on Jun 25

Ok, please try "koolreport/excel": "^7.1" instead. Thanks!

paulo commented on Jun 25

just want to provide an update, I did deploy last night with 7.1 and it seems to have fixed the issue. I left with "*" which basically automatically fins the 7.1.1 version. thank you !

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
bug
help needed
solved

Excel