Raza448 / php-excel-reader

Automatically exported from code.google.com/p/php-excel-reader
0 stars 0 forks source link

Retrieving TYPE doesn't work #47

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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 frederic...@gmail.com on 12 Oct 2009 at 8:16

GoogleCodeExporter commented 8 years ago
Why is this a bug?

Original comment by matthew....@gmail.com on 12 Oct 2009 at 11:10

GoogleCodeExporter commented 8 years ago
It is a bug because at least you could retrieve the data type of a cell but it 
seems
it doesn't retrieve anything, so it's a bug...

Original comment by frederic...@gmail.com on 12 Oct 2009 at 11:19

GoogleCodeExporter commented 8 years ago
This isn't a bug, that is how it's supposed to work. Retrieving the data type 
as you
want is not feasible.

Original comment by matthew....@gmail.com on 12 Oct 2009 at 11:39

GoogleCodeExporter commented 8 years ago
In the documentation it says :

Cell Info

The type of data in the cell: number|date|unknown

    $data->type($row,$col,$sheet=0) 

So it should at least retrieve 'date' when the cell is a date ??? Nope ???

Original comment by frederic...@gmail.com on 12 Oct 2009 at 11:48

GoogleCodeExporter commented 8 years ago
If you have a "date" cell that is not being detected as a date, then you should 
post
the example XLS. Simplify it to just one cell if you can.

Dates that use custom formats may not always be recognized. Even though it is a 
date
to you, internally it is just a number. So the code tries to deduce that it is
actually a date but it's not 100% fool-proof.

Original comment by matthew....@gmail.com on 12 Oct 2009 at 12:19