jasonrogena / jasonrogena/php-excel-reader

Bad count of sheets with ods file

Open
#190 0 comments 0 reactions 0 assignees View on GitHub
auto-migrated Priority-Medium Type-Defect
Dominant language
PHP
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```
I have an xlsx file with 4 sheets. Under Ubuntu, I saved the file in ods format.

I open this files with this code :
set_include_path ( get_include_path () . PATH_SEPARATOR .
'plugins/phpExcel-1.8.0/Classes/' );
include 'PHPExcel/IOFactory.php';
(...)
switch ($ext) {
case 'xls' :
$inputFileType = $objReader = new PHPExcel_Reader_Excel5 ();
break;
case 'ods' :
$objReader = new PHPExcel_Reader_OOCalc ();
break;
case 'xlsx' :
default :
$objReader = new PHPExcel_Reader_Excel2007 ();
}
$objReader->setLoadAllSheets ();
$excel = $objReader->load ( $_FILES ['upfile'] ['tmp_name'] );
$nbfeuille = $excel->getSheetCount ();

With ods file, getSheetCount() found 5 sheets, and the last is empty. In
libreoffice, I have only 4 sheets.

Tanks.

```

Original issue reported on code.google.com by `quinton....@gmail.com` on 17 Jun 2014 at 7:16

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with PHPExcel_Reader_OOCalc and the load path reached through IOFactory.php, focusing on setLoadAllSheets() and getSheetCount() for the reported ODS input. Reproduce the four-sheet file and determine why an empty fifth sheet is loaded; done means the sheet count matches LibreOffice without breaking other ODS files.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.