Code Monkey home page Code Monkey logo

php-excel-reader's People

Watchers

 avatar

php-excel-reader's Issues

Custom and wrong number formats not read

What steps will reproduce the problem?

1.Use a sheet with custom number formats in cell. When the syntax of the format 
is wrong, the 
lib doesn't read the value of the cell.  


What is the expected output? What do you see instead?
Instead of reading the cell's value, it outputs the actual (wrong) syntax of 
the number format.

Please provide any additional information below.
For instance i received a spreadsheet from a customer with custom number 
formats: ???, ????, ???
??. Now, for all the cells that use these formats, the class returns ???, ????, 
?????.

Anyone had the same problem? I know I could just remove all the formats, but it 
should be 
automated somehow in my project, because the files are sent by machines not by 
users. 

THANKS !

Original issue reported on code.google.com by [email protected] on 14 Oct 2009 at 1:26

infinite loop on import

What steps will reproduce the problem?
1. Read in the attached file
2. Get PHP Notice: 

 Undefined index:  in Excel.php on line 196

(i renamed the library to Excel.php)

What is the expected output? What do you see instead?
The webserver times out since the script is in a tailspin.

Please provide any additional information below.
I've attached the excel file I'm using.

Original issue reported on code.google.com by [email protected] on 9 Oct 2009 at 6:50

Attachments:

Perfomance issues with big files

I've got a problem when using reader2 for parsing big Excel files (from 5Mb
filesize)
Seems like it takes more then 75Mb of RAM to build full structure of all
raws and columns. And actually it's more then most of memory limits for
general php settings (mine is 64Mb). I was surprised because first reader
(from Vadim Tkachenko) takes about 55Mb RAM for the same file parsing.
Which is also a lot, but still within limit.

So first idea was to add functionality of to skip some sheets and skip
unneeded cell info (links, colors etc.). I've tried it myself but it gave
me not more then 5Mb RAM saving.

The second idea is to go the same way with XML parsers where beside full
getting of DOM there are bunch of agile readers which get only what we need.
So idea is when we work with big file, like mine. First we parse document
and get only meta data: number of sheets, of columns and rows. And then
call something like $reader->getCell(sheet, col, row) and parse data from
that row.
So in the memory will be only pointers to needed bits, but not all the document

I have not time now to work on it, but if I came up with smth I'll post it here

Thanks,
Nick

Original issue reported on code.google.com by [email protected] on 10 Jun 2009 at 2:14

Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in [...]\xlsReader\excel_reader2.php on line 347

What steps will reproduce the problem?
1. Trying to access a certain xls file (other files are working)
2.
3.

What is the expected output? What do you see instead?
It should just list everything on the first sheet.

Please provide any additional information below.
The code is pretty simple and works with another xls-file, so the problem
somehow lies within the xls itself, but I can't figure out what it might be:
require_once 'pricelist/xlsReader/excel_reader2.php';
$file = $_REQUEST['sheet'];
$xls = new Spreadsheet_Excel_Reader('pricelist/files/'.$file.'');
$numcol = $xls->colcount();
$numrow = $xls->rowcount();

for ($row = 0; $row <= $numrow; $row++) {
 for ($col = 0; $col <= $numcol; $col++) {
  echo $xls->val($row, $col);
  echo ' : ';
 }
 echo '<br>';

}

Original issue reported on code.google.com by [email protected] on 2 Apr 2009 at 10:31

Dates are off

As with the original script I am experiencing wrong date conversion with 
the current version of php-excel-reader.

I am using a standard .XLS-file (Possibly created with Excel 2002 on 
Windows) on a Windows XP PC with PHP 5.2.6 running, everything with german 
localisation and in the timezone UTC+1.

For example: The date '03.10.2008 14:40' gets converted to the (Non 
standard format) '04/10/2008 16:50'.

All dates are 93600 seconds off.

I submit this workaround for line 1095:
    $utcValue = round(($utcDays+1) * SPREADSHEET_EXCEL_READER_MSINADAY - 
93600);

Original issue reported on code.google.com by 128625 on 17 Dec 2008 at 12:03

_format_value call on string overwrites value

In Method _getCellDetails() a call to _format_value() is performed on
string values (line 1133 on version 2.11). 

If the value in the cell happens to be a number but the format is
'GENERAL', the code overwrites the actual value by the FORMAT, effectively
destroying the original value.

Demo: a call to _format_values('GENERAL', 3, 0) returns 'GENERAL' rather
then '3'

This is probably due to line 474, where the predicted subpattern $part[0]
is used as pattern without checking if that makes any logical sense.

Original issue reported on code.google.com by [email protected] on 3 Feb 2009 at 7:12

with the dump function, the width of your excel columns are not set as they should in resulting html code

 When you choose to not display col letters...
__________________________
$data = new Spreadsheet_Excel_Reader($fileurl);
echo $data->dump(false,false);
__________________________

the width of your excel columns are not kept

Solution :
587:    function dump($row_numbers=false,$col_letters=false,
$sheet=0,$table_class='excel') {
586:            $out = "<table class=\"$table_class\" cellspacing=0>";
++              if ($row_numbers) {
++                              $out .= "\n\t\t<col></col>";
++                      }
++              for($i=1;$i<=$this->colcount($sheet);$i++) {
++                              $style = "width:" .
($this->colwidth($i,$sheet)*1) . "px;";
++                              if ($this->colhidden($i,$sheet)) {
++                                      $style .= "display:none;";
++                              }
++                              $out .= "\n\t\t<col style=\"$style\"> </ col>";
++                      }
589:            if ($col_letters) {
590:                    $out .= "<thead>\n\t<tr>";
591:                    if ($row_numbers) {
592:                            $out .= "\n\t\t<th>&nbsp</th>";
593:                    }
594:                    for($i=1;$i<=$this->colcount($sheet);$i++) {
595:                            $style = "width:" .
($this->colwidth($i,$sheet)*1) . "px;";
596:                            if ($this->colhidden($i,$sheet)) {
597:                                    $style .= "display:none;";
598:                            }
599:                            $out .= "\n\t\t<th style=\"$style\">" .
strtoupper($this-
>colindexes[$i]) . "</th>";

600:                    }
601:                    $out .= "</tr></thead>\n";
602:            }

remark : here we take advantage of the <col> tag for setting column
widths. 

Original issue reported on code.google.com by [email protected] on 8 Jul 2009 at 10:38

Little problem with a function in PHP4

The function array_combine does not exist in PHP4, so the library doesn't 
work with this PHP version.

I've replaced this function by the following:

function array_comb ($array1, $array2) {
 $out = array();
 foreach ($array1 as $key => $value) {
  $out[$value] = $array2[$key];
 }
 return $out;
}

And now it's work perfectly.

Thanks for sharing this library, it's very useful and easy to use. :)

Original issue reported on code.google.com by [email protected] on 30 Mar 2009 at 1:08

How do i select a sheet within a work book?

Hi 
I am very new to this so please any1 that can help it would be much
appreciated.

I have been looking for ages now for a reader i found this google one which
works but i have a xls file workbook with multiple sheets. Im trying to
modify this code to get it to look between the sheets if that makes sense?

Please note the below works!! just need help on how to make it do what i
need it to. I would like to be able to get it to cross search/read the
workbook (sheets).

Any help would be much appreiciated

I have attached all 3 files.


example.php
<?php
error_reporting(E_ALL ^ E_NOTICE);
require_once 'excel_reader2.php';
$data = new Spreadsheet_Excel_Reader("book1.xls");

?>
<html>
<head>
<style>
table.excel {
    border-style:ridge;
    border-width:1;
    border-collapse:collapse;
    font-family:sans-serif;
    font-size:12px;
}
table.excel thead th, table.excel tbody th {
    background:#CCCCCC;
    border-style:ridge;
    border-width:1;
    text-align: center;
    vertical-align:bottom;
}
table.excel tbody th {
    text-align:center;
    width:20px;
}
table.excel tbody td {
    vertical-align:bottom;
}
table.excel tbody td {
    padding: 0 3px;
    border: 1px solid #EEEEEE;
}
</style>
</head>

<body>
<?php
echo $data->dump(true,true); 

?>
</body>
</html>

Original issue reported on code.google.com by [email protected] on 8 Aug 2009 at 8:22

Attachments:

Euro sign not working

What steps will reproduce the problem?
- Type a euro sign (alt-0128) in a spreadsheat cel and display this cel
using tge php-excel writer.

What is the expected output? What do you see instead?
- It outputs "¬" in stead of "€"

I think this is an encoding problem?!

Original issue reported on code.google.com by [email protected] on 13 Mar 2009 at 9:38

Character encoding issues

The HTML dump of the attached Excel file does not properly show either the
Russian text, or the Spanish text. 

Two issues: an htmlentities() is done in dump(), regardless of string
encoding. Attached patch uses defaultEncoding as parameter for htmlentities.

The other issue is (from reading the Excel specs @openoffice.org) that what
is called asciiEncoding in the code, is actually compressed UTF-16LE (i.e.,
all high bytes stripped). The compressed string is usually ASCII for
regular characters, but not for accented characters. In the current
version, asciiEncoding strings are not encoded to the defaultEncoding,
thereby leaving the accented characters untranslated. Attached patch
re-inserts all high byte zeros, and always call encodeUTF16.

With these patches, the attached file displays properly in HTML, and the
example.xls from the source code also still seems to work.

PS: a big thank you for this library - we've been messing with the old one
for way too long over here :-)

Original issue reported on code.google.com by [email protected] on 11 Jun 2009 at 7:02

Attachments:

Peform Validation Before uploading the XLS file

Hi,

Im very new to php and excel reader...i have to check xls file so that it
contains total numbers if it contains only a single row and should display
an error if no data present

pleae help

Original issue reported on code.google.com by [email protected] on 5 Aug 2009 at 6:09

wrong value of date and time user-defined format

What steps will reproduce the problem?
1. date and time user-defined format

What is the expected output? What do you see instead?
- 2009-05-18 read MayMay/MonMon/20092009
- 06:30 AM read 0707:JanJan

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 12 May 2009 at 4:35

Attachments:

Reading Date Value

I have a spreadsheet with date values in a column. However phpexcel is 
returning a string value instead.

For example, 24/08/2009 returns 40049. Even typing the date value in other 
format like 08/04/2009 returns 40049.

Original issue reported on code.google.com by [email protected] on 28 Aug 2009 at 3:20

Code to dump only part of sheet or all the sheet

I added 4 more prams to optionally cut out only part of a sheet in a dump.

it adds nice functionality to simply display only part of a sheet.



---snip---

// DUMP AN HTML TABLE OF THE ENTIRE OR PART OF XLS DATA
    // =========================================
    function
dump($row_numbers=false,$col_letters=false,$sheet=0,$table_class='excel',$startr
ow=1,$endrow=0,$startcol=1,$endcol=0)
{
        $out = "<table class=\"$table_class\" cellspacing=0>";
        if ($endcol == 0 ){
                $endcol = $this->colcount($sheet);
        }
        if($endrow ==0){
            $endrow = $this->rowcount($sheet);
        }
        if ($col_letters) {
            $out .= "<thead>\n\t<tr>";
            if ($row_numbers) {
                $out .= "\n\t\t<th>&nbsp</th>";
            }

            for($i=$startcol;$i<=$endcol;$i++) {
                $style = "width:" . ($this->colwidth($i,$sheet)*1) . "px;";
                if ($this->colhidden($i,$sheet)) {
                    $style .= "display:none;";
                }
                $out .= "\n\t\t<th style=\"$style\">" .
strtoupper($this->colindexes[$i]) . "</th>";
            }
            $out .= "</tr></thead>\n";
        }

        $out .= "<tbody>\n";

        for($row=$startrow;$row<=$endrow;$row++) {
            $rowheight = $this->rowheight($row,$sheet);
            $style = "height:" . ($rowheight*(4/3)) . "px;";
            if ($this->rowhidden($row,$sheet)) {
                $style .= "display:none;";
            }
            $out .= "\n\t<tr style=\"$style\">";
            if ($row_numbers) {
                $out .= "\n\t\t<th>$row</th>";
            }
            for($col=$startcol;$col<=$endcol;$col++) {
                // Account for Rowspans/Colspans
                $rowspan = $this->rowspan($row,$col,$sheet);
                $colspan = $this->colspan($row,$col,$sheet);
                for($i=0;$i<$rowspan;$i++) {
                    for($j=0;$j<$colspan;$j++) {
                        if ($i>0 || $j>0) {
                            $this->sheets[$sheet]['cellsInfo'][$row+$i][$col+$j]['dontprint']=1;
                        }
                    }
                }
                if(!$this->sheets[$sheet]['cellsInfo'][$row][$col]['dontprint']) {
                    $style = $this->style($row,$col,$sheet);
                    if ($this->colhidden($col,$sheet)) {
                        $style .= "display:none;";
                    }
                    $out .= "\n\t\t<td style=\"$style\"" . ($colspan > 1?"
colspan=$colspan":"") . ($rowspan > 1?" rowspan=$rowspan":"") . ">";
                    $val = $this->val($row,$col,$sheet);
                    if ($val=='') { $val="&nbsp;"; }
                    else {
                        $val = htmlentities($val);
                        $link = $this->hyperlink($row,$col,$sheet);
                        if ($link!='') {
                            $val = "<a href=\"$link\">$val</a>";
                        }
                    }
                    $out .= "<nobr>".nl2br($val)."</nobr>";
                    $out .= "</td>";
                }
            }
            $out .= "</tr>\n";
        }
        $out .= "</tbody></table>";
        return $out;
    }


---snip---

Original issue reported on code.google.com by [email protected] on 30 Mar 2009 at 9:06

No formattings displayed when "Standard" cell is empty

Take a "Standard" style cell (not Text, nor number kind cell) that is
formatted with a background color and even borders, but with no text
or just containing the number zero (that can be the result of a
formula too), the cell is not displayed at all !!!

The problem disapears as sson as you put any non-zero value in it, or a
text, or you change the cell kind (from "Standard" to "Text" for
instance).

I didn't find any code fix for this and I badly need one ! 

Original issue reported on code.google.com by [email protected] on 8 Jul 2009 at 10:41

error reading file created with Excel 2004 for Mac

Attempting to import the attached Test.xls file will result in

Notice: Undefined property: rootentry in excel_reader2.php on line 232
Notice: Undefined index: in excel_reader2.php on line 232
Notice: Undefined index: in excel_reader2.php on line 195
[last error repeats infinitely]

Attached patch.diff appears to resolve the problem.

For reference this is excel_reader2.php Version 2.21 on a G5 PowerMac with OS X 
10.4.11 and PHP 
4.4.9 (cli) using Excel 2004 for Mac 11.5.4

Original issue reported on code.google.com by [email protected] on 29 May 2009 at 6:22

Attachments:

Provide GPL Licensed Version

Hi,

We included your code in a GPL licensed project 
(http://smoothoperator.googlecode.com), but 
when the project was being parsed by Ohloh, it said that there is a license 
incompatibility between 
the PHP license and the GPL.

Is there any chance of releasing a version under the GPL license or dual 
licensing it?

Original issue reported on code.google.com by [email protected] on 12 Oct 2009 at 9:35

Does not work with a specific .xls file

What steps will reproduce the problem?
1. Read an excel file


What is the expected output? What do you see instead?
Data of excel. 
The filename /var/www/data.xls is not readable.

What version of the product are you using? On what operating system?
Latest currently available. CentOS

Please provide any additional information below.
It work with the example file.

Error occur at this point.
if (substr($this->data, 0, 8) != IDENTIFIER_OLE) {
            $this->error = 1;
            return false;
        }


Original issue reported on code.google.com by [email protected] on 4 Mar 2009 at 9:30

when you set borders around fusioned cells in excel they are not displayed correctly by the dump function

Version used : 2.21

when you drow borders around cells that are fusioned in
excel, they are not displayed as it should.
Sample step to reproduce : in excel, take a rectangle of 2x3 cells,
write a text in this fusion, set a border around this fusion.

Solution (the number on the left is the line number in
excel_reader2.php) :
445:    // Borders
446:    $bLeft = $this->borderLeft($row,$col,$sheet);
447:    $bRight = $this->borderRight($row,$col,$sheet);
448:    $bTop = $this->borderTop($row,$col,$sheet);
449:    $bBottom = $this->borderBottom($row,$col,$sheet);
450:    $rowspan = $this->rowspan($row,$col,$sheet);
+       $colspan = $this->colspan($row,$col,$sheet);
+       if ($rowspan>1) { $bBottom=$this->borderBottom($row+$rowspan-1,$col+
$colspan-1,$sheet); }
+       if ($colspan>1) { $bRight=$this->borderRight($row+$rowspan-1,$col+
$colspan-1,$sheet); }
451:    $bLeftCol = $this->borderLeftColor($row,$col,$sheet);
452:    $bRightCol = $this->borderRightColor($row,$col,$sheet);
453:    $bTopCol = $this->borderTopColor($row,$col,$sheet);
454:    $bBottomCol = $this->borderBottomColor($row,$col,$sheet); 

Original issue reported on code.google.com by [email protected] on 8 Jul 2009 at 10:36

Invalid rowcount / numrows

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:

data gets chopped off

What steps will reproduce the problem?
1.use your code provided to read this file
2.look into the emg file description field
3.then compare it with the output of your code the data gets chopped off

What is the expected output? What do you see instead?


Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 2 May 2009 at 10:34

Attachments:

Memory Exhaust on $streamdata variable

I'm getting a memory error on the

getWorkBook function

so on line ~238 
$streamData .= substr($rootdata, $pos, SMALL_BLOCK_SIZE);

I've already changed the max execution limit (0) and memory limit in my 
.ini file is at 200M. I've also included the error reporting line for E_ALL 
and E_NOTICE. For one, I installed AppServ on a Dell GX620 with 3.2Ghz P4 
with 1 gig of ram on winxp. So, the AppServ and system aren't the greatest 
but that's all I had to work with to access the local excel files. Next, 
I'm looping through a readdir of about 2000 excel files (160M) in order to 
extract a few bits of info from each. My script gets through about 1700 xls 
files and extracts the info I need but it's not making it past the last 
200-300. So, I'm really at a lost cause the scripts working great and I've 
already changed the GetInt4d and _GetInt4d (magical??)functions but I'm on 
32bit archy so results have been the same. I've also been unsetting 
variables left and right. 

I know there may be some problems due to the crap machine or AppServ quick 
AMP install, but everything seems to be working and all the paths look good 
to me. 

Any suggestions on what I can try to get my script to finish to completion. 
All I need is the data so the extended info cells is turned off (false) and 
I hardcoded that in the function cause I think there were problems with the 
call always being on, but I want to say the read() still wants to get 
additional cell info which may be pushing the data chunks or memory limits.

Thanks for any ideas for me to try. Otherwise, very nice update to the 
sourceforge and works in many other instances for me at 100% but this one 
time I'm only getting about 90% completion.  

Original issue reported on code.google.com by [email protected] on 9 Oct 2009 at 9:20

Support for caching results (patch included)

I don't think it's a good idea to process the spreadsheet file over and over 
again, especially as it 
may not change very frequently.

Here's a little function to cache the results of the spreadsheet read as a PHP 
object. Make sure 
you create the cache directory and make sure it can be written to.

best,
matt

function Cached_Spreadsheet($filename) {
    $cache_dir = './cache';     //set to null to disable cache
    $xlsmtime = filemtime($filename);
    $cached = false;

    // If CACHE ENABLED
    if ($cache_dir != '' && file_exists($cache_dir)) {
        $cache_file = $cache_dir . '/xlscache_' . md5($filename);
        $timediff = @($xlsmtime != filemtime($cache_file));
        if ($timediff && file_exists($cache_file)) {
            // cached file is fresh enough, return cached array
            $result = unserialize(join('', file($cache_file)));
            // set 'cached' to 1 only if cached file is correct
            if ($result) $cached = true;
        } else {
            // cached file is too old, create new
            $result = new Spreadsheet_Excel_Reader($filename, false);
            $serialized = serialize($result);
            if ($f = @fopen($cache_file, 'w')) {
                fwrite ($f, $serialized, strlen($serialized));
                fclose($f);
            }
            if ($result) $cached = false;
        }
    } else {
        // If CACHE DISABLED >> load and parse the file directly
        $result = new Spreadsheet_Excel_Reader($filename, false);
        if ($result) $cached = false;
    }

    if ($cached) echo "<!-- cached result -->\n";

    // return result
    return $result;
}

$xls = Cached_Spreadsheet("example.xls");

Original issue reported on code.google.com by [email protected] on 11 Mar 2009 at 3:53

Attachments:

Date format, cells with 0 and a question

Hi,
first of all many thank for yr good library. I'm sure that will have a 
great future. Have two small problems and a question :
- have an excel file where the format of the dates is mmmm yyyy (May 2009) 
but the array created by the function shows May/2009 (space is replaced by 
the /) See attached file cells C8:C128
- the dump function doesn't display cella where the value is 0 even if the 
array is created correctly (see cell B8). This is not a big issue because 
problem seems limited to the dump function

The question is : is it possible to show/know that a cell contains a 
formula (and maybe retrieve the original formula) ? See cell G9

Tks, regards

Original issue reported on code.google.com by [email protected] on 15 May 2009 at 1:11

Attachments:

Date output not standard

The standard date output is not in a standard format which can be read (for 
example) by the strtotime()-function.

The current output is days/months/years. This notation usually calls either 
for dots:
  days.months.years

Or for another order:
  months/days/years

I don't know if this is an Excel problem or a problem with the script 
interpreting the right date format.

Workaround:
 Change the date formats around lines 410-420 to your liking.

Original issue reported on code.google.com by 128625 on 17 Dec 2008 at 12:14

Wrong Encoding for values

In version 2.11, the line 771 decides whether or not a string is ascii
encoded or not. As it seems this is not working reliably, for only UTF16LE
strings are "decoded" to the requested defaultEncoding.

My workaround/hack for now is to replace line 771 with this:

$retstr = ($asciiEncoding) ? iconv('cp1250', $this->_defaultEncoding,
$retstr) : $this->_encodeUTF16($retstr);

I'm not fully convinced using an hardcoded encoding of cp1250 is a good
idea but it seems to work in my testcase.


Original issue reported on code.google.com by [email protected] on 4 Feb 2009 at 10:24

negate numbers showing incorrectly when created in openoffice or neooffice

What steps will reproduce the problem?
1.Create a spreadsheet with negative numbers
-1  -5  -10 -50 -100    -250
2. Save the document as an xls file (97/2000/xp)
3. Read the spreadsheet using php-excell-reader

What is the expected output? 
The data should show 
-1  -5  -10 -50 -100    -250

What do you see instead?
-1  1073741819  1073741814  1073741774  1073741724  1073741574


Please provide any additional information below.

Debugging this shows that we are in 
case SPREADSHEET_EXCEL_READER_TYPE_MULRK:

and that in the call to function  _GetIEEE754($rknum) we fall into the case
($rknum & 0x02) != 0)



Original issue reported on code.google.com by [email protected] on 8 Jun 2009 at 6:16

Attachments:

Missing data

Hey there, I have a slightly modified version of your script, but I checked
a default copy to make sure it was an issue instead of my problem.
For some reason, certain values are not being saved.
I know part of it is the way excel is saving the information.  I noticed a
few numbers aligned as if they were text, but I fixed those.

I'm attaching a sample file.  Specificly, the part number fields are not
showing up...

Original issue reported on code.google.com by [email protected] on 23 Feb 2009 at 8:56

Attachments:

Open xlsx

1. It's possible to import a *.xlsx file? (Excel 2007)  When I import this 
displays a "not readable" error.

P.D. It's a very great class for php. Thank you! 

Original issue reported on code.google.com by [email protected] on 5 Jun 2009 at 9:03

non-ASCII characters

What steps will reproduce the problem?
there is problem to show non ASCII characters (e.g.: ľščťžý..)

What is the expected output? What do you see instead?
showed: ľš�ťžýáíéúäô�
expected: ľščťžýáíéúäôň


Please provide any additional information below.
correction - excel_reader2.php (line 635):
$val = htmlentities($val, ENT_NOQUOTES, 'UTF-8'); 

Original issue reported on code.google.com by [email protected] on 28 Apr 2009 at 9:14

split() is deprecated in PHP 5.3

On line 79 and 844, the code makes references to the split() function,
which is deprecated in PHP 5.3.0 and will be removed in PHP 6.0.  The code
should be modified to use explode() (which is reverse compatible with older
versions of PHP).

Original issue reported on code.google.com by wiley14 on 12 Oct 2009 at 2:38

MM/DD/YY format dates output as (e.g.) "JanJan/ThuThu/19701970"

What steps will reproduce the problem?
1. Upload a spreadsheet with a date column in MM/DD/YY format
2. Parse spreadsheet with php-excel-reader
3. date column output as "JanJan/ThuThu/19701970"

What is the expected output? What do you see instead?

I would expect to see "01/01/1970"



Original issue reported on code.google.com by [email protected] on 2 Jul 2009 at 7:33

Boolean and String Formulas are not supported

What steps will reproduce the problem?
1. Put a formula in spreadsheet with boolean or string result

What is the expected output? What do you see instead?
Desired output is the result of the formula in the cells array. Instead, it
is as if the cell is empty.

What version of the product are you using? On what operating system?
NA

Please provide any additional information below.
I have a private version of the code in which I've made the necessary
changes to support boolean (see mmpbool) and string (see mmptext) strings.
Please note, this is based on an older version of the code when the
constants were not all uppercase. In any case, here is the code in case you
would like to incorporate it into the next release:


                case Spreadsheet_Excel_Reader_Type_FORMULA:
                case Spreadsheet_Excel_Reader_Type_FORMULA2:
                    $row    = ord($this->data[$spos]) |
ord($this->data[$spos+1])<<8;
                    $column = ord($this->data[$spos+2]) |
ord($this->data[$spos+3])<<8;
                    if ((ord($this->data[$spos+6])==0) &&
(ord($this->data[$spos+12])==255) && (ord($this->data[$spos+13])==255)) {
                        //String formula. Result follows in a STRING record
//mmptext begin                        
                        echo "FORMULA $row $column Formula with a
string<br>\n";
                        $SAVErow = $row; $SAVEcolumn = $column;
                        // the SAVE values are used in the STRING record
//mmptext end                        
                    } elseif ((ord($this->data[$spos+6])==1) &&
(ord($this->data[$spos+12])==255) && (ord($this->data[$spos+13])==255)) {
                        //Boolean formula. Result is in +2; 0=false,1=true
//mmpbool begin                       
                        if (ord($this->data[$spos+8])==1) {
                            $this->addcell($row, $column, "TRUE", 1);
                        } else {
                            $this->addcell($row, $column, "FALSE", 0);
                        }
//mmpbool end                       
                    } elseif ((ord($this->data[$spos+6])==2) &&
(ord($this->data[$spos+12])==255) && (ord($this->data[$spos+13])==255)) {
                        //Error formula. Error code is in +2;
                    } elseif ((ord($this->data[$spos+6])==3) &&
(ord($this->data[$spos+12])==255) && (ord($this->data[$spos+13])==255)) {
                        //Formula result is a null string.
//mmptext begin                        
                        $this->addcell($row, $column, '');
//mmptext end                        
                    } else {
                        // result is a number, so first 14 bytes are just
like a _NUMBER record
                        $tmp = unpack("ddouble", substr($this->data, $spos
+ 6, 8)); // It machine machine dependent
                        if ($this->isDate($spos)) {
                            list($string, $raw) =
$this->createDate($tmp['double']);
                         //   $this->addcell(DateRecord($r, 1));
                        }else{
                            //$raw = $tmp[''];
                            if (isset($this->_columnsFormat[$column + 1])){
                                    $this->curformat =
$this->_columnsFormat[$column + 1];
                            }
                            $raw = $this->createNumber($spos);
                            $string = sprintf($this->curformat, $raw *
$this->multiplier);

                         //   $this->addcell(NumberRecord($r));
                        }
                        $this->addcell($row, $column, $string, $raw);
                        //echo "Number $row $column $string\n";
                    }
                    break;                    
//mmptext begin                    
                case Spreadsheet_Excel_Reader_Type_STRING:
            echo "Found a STRING\n<br>";
            if ($version == Spreadsheet_Excel_Reader_BIFF8){
                // Unicode 16 string, like an SST record
            echo "In STRING section, BIFF8\n<br>";
                        $xpos = $spos;
                                                $numChars =
ord($this->data[$xpos]) | (ord($this->data[$xpos+1]) << 8);
                                                $xpos += 2;
                                                $optionFlags =
ord($this->data[$xpos]);
                                                $xpos++;
                                        $asciiEncoding = (($optionFlags &
0x01) == 0) ;
                                                $extendedString = (
($optionFlags & 0x04) != 0);

                                                // See if string contains
formatting information
                                                $richString = (
($optionFlags & 0x08) != 0);

                                                if ($richString) {
                                        // Read in the crun
                                                        $formattingRuns =
ord($this->data[$xpos]) | (ord($this->data[$xpos+1]) << 8);
                                                        $xpos += 2;
                                                }

                                                if ($extendedString) {
                                                  // Read in cchExtRst
                                                  $extendedRunLength =
$this->_GetInt4d($this->data, $xpos);
                                                  $xpos += 4;
                                                }

                                                $len = ($asciiEncoding)?
$numChars : $numChars*2;
                                                $retstr =
substr($this->data, $xpos, $len);
                                                $xpos += $len;

                                                $retstr = ($asciiEncoding)
? $retstr : $this->_encodeUTF16($retstr);
                                                echo "Str = $retstr\n<br>";
                                                //$this->sst[]=$retstr;
                    }elseif ($version == Spreadsheet_Excel_Reader_BIFF7){
                // Simple byte string
                echo "In STRING section, BIFF7\n<br>";
                        $xpos = $spos;
                                                $numChars =
ord($this->data[$xpos]) | (ord($this->data[$xpos+1]) << 8);
                                                $xpos += 2;
                                                $retstr =
substr($this->data, $xpos, $numChars);
                                                echo "Str = $retstr\n<br>";
                    }
                    $this->addcell($SAVErow, $SAVEcolumn, $retstr);
            break;
//mmptext end            
                case Spreadsheet_Excel_Reader_Type_BOOLERR:



Original issue reported on code.google.com by [email protected] on 19 Dec 2008 at 9:34

Defect Character Encoding in utf-8

What steps will reproduce the problem?
1. the â character is not displayed correctly if it's the only special
character in that line (or if there are more like it).
2. if it's accompanied by other similar characters is displayed correctly
(like ăîşţ)
3.

What is the expected output? What do you see instead?


Please provide any additional information below.
in exaple there are 4 lines (rows)...that exeplifies the ouput (lines 1-3
contain only the problematic character; lines 2-4 contain another special
characther in addition to lines 1-3). 1,2 are lowercase, 3,4 are uppercase.

Original issue reported on code.google.com by [email protected] on 27 Jul 2009 at 12:56

Attachments:

Serious issue while reading data

What steps will reproduce the problem?

1. I have excel file, and the two cell having same data.

2. But the reader is skipping the 2nd cell's data and idea why reader not
reading the 2nd cell data ?




Original issue reported on code.google.com by [email protected] on 5 Oct 2009 at 2:04

Undefined errors in version 2.2

What steps will reproduce the problem?
1. Import any xls file
2.
3.

What is the expected output? What do you see instead?
I expect to only see my data instead I see several undefined errors.

Please provide any additional information below.
The undefined errors have been fixed in the attached version. I hope you
will include them in the next release.

Original issue reported on code.google.com by [email protected] on 31 Mar 2009 at 6:38

Attachments:

Can't display chinese word!

What is the expected output? What do you see instead?

銷售貨單號碼  地區  Con. Name   未能完成送貨原因    跟進/結果

Please provide any additional information below.

Cannot display chinese correctly, but if i modify the line 635 to :

$val = htmlentities($val,ENT_NOQUOTES, 'utf-8'); 

that will be fine for everything

Original issue reported on code.google.com by [email protected] on 14 Jul 2009 at 8:57

Attachments:

script freezing issue

I had a problem with this new version, and the older version of the Excel 
Reader, where on certain files the script would timeout, or exhuast all 
availible memory.

When i debugged the script and the xls file i was working with, i found the 
'name' of the file in the propery array was "WORKBOOK"

On line 246 of excel_reader2.php you have 
    if ($name == "Workbook")

Changed this to:
     if ((strtolower($name) == "workbook")


This fixed the problem.




Original issue reported on code.google.com by [email protected] on 14 Feb 2009 at 7:51

Memory usage

Hi there,
good to see that somebody picked up development of this class.

For quite some time I was worried by the heavy memory usage Excel_Reader
shows when dealing with larget excel files.
Today I digged around a bit in the code, and I was able to reduce memory
usage (memory_get_peak_usage) down from 71MB to 16MB for a ~11.000 rows
excel file.
I removed / commented out 4 lines in function addcell(), namely
$this->sheets[$this->sn]['cellsInfo'][$row + $this->_rowoffset][$col +
$this->_coloffset]['raw'] = $raw;
$this->sheets[$this->sn]['cellsInfo'][$row + $this->_rowoffset][$col +
$this->_coloffset]['type'] = $type;
$this->sheets[$this->sn]['cellsInfo'][$row + $this->_rowoffset][$col +
$this->_coloffset]['format'] = $format;
$this->sheets[$this->sn]['cellsInfo'][$row + $this->_rowoffset][$col +
$this->_coloffset]['formatIndex'] = $formatIndex;

Those 4 entries alone were responsible for such a huge overhead, and I
didn't really need those information for my further processing. And as it
seems, the class itself doesn't either.

What I'd really like to see and what I was already searching for, is a
'streaming' reading of excel files, where you don't need to have the whole
excel file in memory to process.
But alas, such thing doesn't seem to exist, so for the time being I'm
content with such a dramatic decrease in memory usage with the currently
available class.

Original issue reported on code.google.com by [email protected] on 5 Dec 2008 at 1:49

Retrieving TYPE doesn't work

What steps will reproduce the problem?
1.require_once 'Excel/excel_reader2.php';
2.$data = new Spreadsheet_Excel_Reader("Classeur3.xls");
3.for($row=1;$row<=$data->rowcount($sheet=0);$row++) {
    for($col=1;$col<=$data->colcount($sheet=0);$col++) {
        echo "row : ".$row."<br>";
        echo "col : ".$col."<br>";
        echo "type : ".$data->type($row,$col,$sheet=0)."<br>";
        echo "value : ".$data->val($row,$col,$sheet=0)."<br>";
        echo "raw : ".$data->raw($row,$col,$sheet=0)."<br>";
    }

}


What is the expected output? What do you see instead?
I see nothing for Type, expecting Number or Date ???


Original issue reported on code.google.com by [email protected] on 12 Oct 2009 at 8:16

Large file support not working

Hey there, just grabbed the newest version you had to test on a 15 meg file.
Before I did, I edited the example file and changed the class call to new
Spreadsheet_Excel_Reader("example.xls",false).

Added print_r($xls);
And checked the output for cellsinfo.  It was there.

It doesn't look like there is anything in the constructor for this change,
so maybe you uploaded a slighly older file.

Original issue reported on code.google.com by [email protected] on 27 Jan 2009 at 3:10

raw() function not working properly

What steps will reproduce the problem?
1. just try to read raw data. 
2.
3.

What is the expected output? What do you see instead?
I expected cell content. received empty values

Please provide any additional information below.
if I use ->val instead of ->raw i can read the data. The class opens the 
file and recognizes the number of rows and columns.

Original issue reported on code.google.com by [email protected] on 5 May 2009 at 4:01

Reading password-protected Excel files

I've tried to do a little research about this, but is there any way of
reading password-protected ("encrypted"?) Excel files -- of course under
the assumption that the password is supplied? Could this be implemented
into this class? Thoughts?

Original issue reported on code.google.com by [email protected] on 29 May 2009 at 6:51

PHP-Excel-Reader only reading first 16384 rows of my spreadsheet

What steps will reproduce the problem?
1.Upload this .xls file.
2.Use the Dump method to display it.
3.

What is the expected output? What do you see instead?
I expect to see the entire spreadsheet but I only see the first 16384 rows

Please provide any additional information below.
Here is the relevant code from my program
   $data = new Spreadsheet_Excel_Reader($import_file, false, 'CP1251');
   echo $data->dump(true);

Original issue reported on code.google.com by [email protected] on 30 Aug 2009 at 3:32

Attachments:

Arabic Text

What steps will reproduce the problem?
1. Use and Excel Sheet with Arabic Data
2.
3.

What is the expected output? Arabic Output
What do you see instead? Garbled Text


All Excel Sheets with Arabic Data give garbled output.

Original issue reported on code.google.com by [email protected] on 26 Apr 2009 at 7:46

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.