Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid rowcount / numrows #37

Open
GoogleCodeExporter opened this issue Apr 21, 2016 · 5 comments
Open

Invalid rowcount / numrows #37

GoogleCodeExporter opened this issue Apr 21, 2016 · 5 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. On some XLS files with multiple sheets, the rowcount is not valid
2. Read XLS file
3. Dump sheet 2

require_once 'excel_reader2.php';
$data = new Spreadsheet_Excel_Reader("example.xls");
echo $data->dump(true,true, 1);


What is the expected output? What do you see instead?
The attached file as 29 rows in the 2nd sheet, when read it 12579 rows are 
found !


Please provide any additional information below.
Get attached XLS file as sample to reproduce

Original issue reported on code.google.com by [email protected] on 20 Jul 2009 at 4:53

Attachments:

@GoogleCodeExporter
Copy link
Author

I downloaded your xls file and opened it with excel :

Look at the scrollbar on the right :
- on 1st sheet, it is spreading all over the height and if you scroll it down 
you
reach  line number 26.
- Now, on 2nd sheet, the height of the scrollbar is very small, and if you 
slide it
to the bottom, you reach line 12579 !

Thus, excel reports itself 12579 lines on this sheet !

Solution : delete rows from row number 30 to 12579, then save ;p

Original comment by [email protected] on 21 Jul 2009 at 10:31

@GoogleCodeExporter
Copy link
Author

a small tip: when you are in excel, press Ctrl-End (or End and then Home) and 
the 
excel cursor will move to the last row / last column (bottom right corner) 
that, in 
the 2nd sheet is AH12579.
Cheers

Original comment by [email protected] on 28 Jul 2009 at 8:22

@GoogleCodeExporter
Copy link
Author

Hi.

 im using this php reader to retrieving data from xls sheet and its works well the xls sheet having 150 records. its limited to 20 records per page to show on result page .there is a search box and button to
search some specific data from the sheet, the search parameter giving the 
result from first 20 Records only. i can't get result from full excel sheet.


i dont understan whats wrong here, y can't search full records on xls sheet.
im expecting some ones help to solve my problem. and the PHP file is blow here 
to download. 
thnxx..

Original comment by [email protected] on 1 Aug 2011 at 2:49

Attachments:

@GoogleCodeExporter
Copy link
Author

If you're having issues with rowCount() and numRows displaying ridiculously 
high values, try the following:

    max(count($data->sheets[$sheet]['cells']) - 1, 0);

This assumes your sheets have header rows (If not, remove the "- 1" part), 
$data is your Spreadsheet_Excel_Reader class and your sheet number is stored in 
$sheet.

In all honesty, the lines at 1354 and 1357 in excel_reader2.php should be 
replaced with the above instead of relying on Excel to accurately report the 
number of rows in the sheet...

Original comment by [email protected] on 3 Aug 2012 at 11:00

@GoogleCodeExporter
Copy link
Author

the suggestion to use 
max(count($data->sheets[$sheet]['cells']) - 1, 0);
instead of relying on $data->sheets[0]['numRows'] works.

Original comment by [email protected] on 1 Apr 2013 at 9:40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant