vkGunasekaran
vkGunasekaran

Reputation: 6814

Reading negative values from excel file using php

I need to read excel data. so i've used phpExcelReader . It worked great, but unfortunately it doesn't reading negative values in 64 bit architecture.

In 32 bit architecture it doesn't any problems in reading negative values. I don't know how to get around this issue? Any help will be greatly appreciated. Thanks!

The webserver has 64 bit processor and php version 5.3.4 and it runs on linux platform

Upvotes: 1

Views: 1625

Answers (2)

Vlado
Vlado

Reputation: 3797

Let me clarify this issue once again. Find the OLERead class (in my case in excel_reader2.php) and replace the bodies of both these two methods:

_GetInt4d() and GetInt4d()

with this code:

function GetInt4d($data, $pos) {
    $value = ord($data[$pos]) | (ord($data[$pos+1]) << 8) | (ord($data[$pos+2]) << 16) | (ord($data[$pos+3]) << 24);
    if ($value>=4294967294) {
        $value=-2;
    }
    return $value;
}

Now the class supports both the 32 and 64 bit OS architectures. I hope it is now clear and helps.

Upvotes: 0

Manigandan Arjunan
Manigandan Arjunan

Reputation: 2265

Check the below link on this issue. May be this is what you are looking for, http://code.google.com/p/php-excel-reader/issues/detail?id=123 also http://code.google.com/p/php-excel-reader/issues/detail?id=28

Upvotes: 2

Related Questions