PHPOffice / PHPExcel

ARCHIVED
Other
11.46k stars 4.19k forks source link

[BUG] Error in parsing rows(?) from Google Sheets-generated .xlsx #1162

Open enprixd opened 7 years ago

enprixd commented 7 years ago

I have been advised to seek help over here, from the package that's using this package.

Here's a link to the issue over at maatwebsite/excel. https://github.com/Maatwebsite/Laravel-Excel/issues/1127

I hope you guys can help me, or maybe at least, tell me what I did wrong? Thanks!

Package version, Laravel version

"maatwebsite/excel": "^2.1",
"laravel/framework": "5.3.*",

Expected behaviour

Successful loading of Excel Sheet

Actual behaviour

image

Exception stack trace

in Cell.php line 809
at HandleExceptions->handleError('8', 'Undefined index: $', '/home/vagrant/code/client-project-thingamajig/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell.php', '809', array('pString' => '$A', '_indexCache' => array('A' => '1', 'B' => '2', 'C' => '3', 'D' => '4', 'E' => '5', 'F' => '6', 'G' => '7', 'H' => '8', 'I' => '9', 'J' => '10', 'K' => '11', 'L' => '12', 'M' => '13', 'N' => '14', 'O' => '15', 'P' => '16', 'Q' => '17', 'R' => '18', 'S' => '19', 'T' => '20', 'U' => '21', 'V' => '22', 'W' => '23', 'X' => '24', 'Y' => '25', 'Z' => '26'), '_columnLookup' => array('A' => '1', 'B' => '2', 'C' => '3', 'D' => '4', 'E' => '5', 'F' => '6', 'G' => '7', 'H' => '8', 'I' => '9', 'J' => '10', 'K' => '11', 'L' => '12', 'M' => '13', 'N' => '14', 'O' => '15', 'P' => '16', 'Q' => '17', 'R' => '18', 'S' => '19', 'T' => '20', 'U' => '21', 'V' => '22', 'W' => '23', 'X' => '24', 'Y' => '25', 'Z' => '26', 'a' => '1', 'b' => '2', 'c' => '3', 'd' => '4', 'e' => '5', 'f' => '6', 'g' => '7', 'h' => '8', 'i' => '9', 'j' => '10', 'k' => '11', 'l' => '12', 'm' => '13', 'n' => '14', 'o' => '15', 'p' => '16', 'q' => '17', 'r' => '18', 's' => '19', 't' => '20', 'u' => '21', 'v' => '22', 'w' => '23', 'x' => '24', 'y' => '25', 'z' => '26'))) in ErrorHandler.php line 36
at Raven_Breadcrumbs_ErrorHandler->handleError('8', 'Undefined index: $', '/home/vagrant/code/client-project-thingamajig/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell.php', '809', array('pString' => '$A', '_indexCache' => array('A' => '1', 'B' => '2', 'C' => '3', 'D' => '4', 'E' => '5', 'F' => '6', 'G' => '7', 'H' => '8', 'I' => '9', 'J' => '10', 'K' => '11', 'L' => '12', 'M' => '13', 'N' => '14', 'O' => '15', 'P' => '16', 'Q' => '17', 'R' => '18', 'S' => '19', 'T' => '20', 'U' => '21', 'V' => '22', 'W' => '23', 'X' => '24', 'Y' => '25', 'Z' => '26'), '_columnLookup' => array('A' => '1', 'B' => '2', 'C' => '3', 'D' => '4', 'E' => '5', 'F' => '6', 'G' => '7', 'H' => '8', 'I' => '9', 'J' => '10', 'K' => '11', 'L' => '12', 'M' => '13', 'N' => '14', 'O' => '15', 'P' => '16', 'Q' => '17', 'R' => '18', 'S' => '19', 'T' => '20', 'U' => '21', 'V' => '22', 'W' => '23', 'X' => '24', 'Y' => '25', 'Z' => '26', 'a' => '1', 'b' => '2', 'c' => '3', 'd' => '4', 'e' => '5', 'f' => '6', 'g' => '7', 'h' => '8', 'i' => '9', 'j' => '10', 'k' => '11', 'l' => '12', 'm' => '13', 'n' => '14', 'o' => '15', 'p' => '16', 'q' => '17', 'r' => '18', 's' => '19', 't' => '20', 'u' => '21', 'v' => '22', 'w' => '23', 'x' => '24', 'y' => '25', 'z' => '26'))) in Cell.php line 809
at PHPExcel_Cell::columnIndexFromString('$A') in Cell.php line 729
at PHPExcel_Cell::rangeBoundaries('$A$1:$F$25') in AutoFilter.php line 131
at PHPExcel_Worksheet_AutoFilter->setRange('$A$1:$F$25') in Excel2007.php line 1012
at PHPExcel_Reader_Excel2007->load('/tmp/phpNgoiys') in LaravelExcelReader.php line 266
at LaravelExcelReader->load('/tmp/phpNgoiys', null, false, null) in Excel.php line 119
at Excel->load('/tmp/phpNgoiys', object(Closure)) in Facade.php line 237
at Facade::__callStatic('load', array('/tmp/phpNgoiys', object(Closure))) in SomeKindOfCustomController.php line 268
at SomeKindOfCustomController->importExcel(object(Request))
at call_user_func_array(array(object(SomeKindOfCustomController), 'importExcel'), array(object(Request))) in Controller.php line 55
at Controller->callAction('importExcel', array(object(Request))) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(SomeKindOfCustomController), 'importExcel') in Route.php line 189
at Route->runController() in Route.php line 144
at Route->run(object(Request)) in Router.php line 653
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in BackendAuthenticate.php line 49
at BackendAuthenticate->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Router.php line 655
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 629
at Router->dispatchToRoute(object(Request)) in Router.php line 607
at Router->dispatch(object(Request)) in Kernel.php line 268
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Debugbar.php line 51
at Debugbar->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Kernel.php line 150
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 117
at Kernel->handle(object(Request)) in index.php line 53

Screenshot of Excel file

image

Steps to reproduce the behaviour

Upload the excel sheet then parse it using this code

Excel::load($path, function (LaravelExcelReader $reader) {
            dd($reader);
});

Using this file https://docs.google.com/spreadsheets/d/1Nz9FqLIEaJMr88HBTJ8rQ3vzScv9Z1VFoS5aVEjzYkw/edit?usp=sharing

cinco-de-mauro commented 7 years ago

Also having this issue. Any solutions or suggestions?

ahshum commented 7 years ago

Having the same issue.

It seems something related to the filter on Google spreadsheet because errors disappear when I download with filter OFF.