You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [x] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
What is the expected behavior?
You can read sheetData by this.
public function getSheetData($sheetName)
{
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
$spreadsheet = $reader->load("/var/www/storage/app/upload_file.xlsx");
$sheetData = $spreadsheet->getSheetByName($sheetName)->toArray();
return $sheetData;
}
What is the current behavior?
ErrorException (E_ERROR)
sheet!A2 -> Formula Error: Unexpected
<?phpnamespaceApp\Http\Controllers;
class ReadController
{
private$spreadsheet = array();
publicfunction__construct()
{
$this->read();
}
privatefunctionread()
{
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
$this->spreadsheet = $reader->load("/var/www/storage/app/upload_file.xlsx");
}
publicfunctiongetSheetData($sheetName)
{
//error at this code$sheetData = $this->spreadsheet->getSheetByName($sheetName)->toArray();
return$sheetData;
}
Which versions of PhpSpreadsheet and PHP are affected?
PhpSpreadsheet - latest
PHP - 7.2
Laravel - 5.7
The text was updated successfully, but these errors were encountered:
azuma560
changed the title
Can't $sheetData->toArray() if the .xlsx file sheet contains SWITCH()
Can't work $sheetData->toArray() if the .xlsx file sheet contains SWITCH()
Apr 16, 2019
This is:
What is the expected behavior?
You can read sheetData by this.
What is the current behavior?
ErrorException (E_ERROR)
sheet!A2 -> Formula Error: Unexpected
What are the steps to reproduce?
A2
=SWITCH(B2,0,"ja",1,"en",2,"cs",3,"ko",4,"vi")
B2
=2
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
Which versions of PhpSpreadsheet and PHP are affected?
PhpSpreadsheet - latest
PHP - 7.2
Laravel - 5.7
The text was updated successfully, but these errors were encountered: