I am using phpexcelreader:
http://sourceforge.net/projects/phpexcelreader/
And It is working nicely compared to all the others I tried, But I am struggling to find a way to get background colors of the cells, or any color formatting to be honest.
Does anyone know of how to do this with this class, or, how to add it into this class?
It can't be too hard, surely?
Assuming that $data
is the phpExcelReader object you can use:
$data->bgColor($row,$col,$sheet=0);
which is returned in #FFFFFF
format.
I think you can find some good docs here: http://code.google.com/p/php-excel-reader/wiki/Documentation
From user comments, the updated syntax is:
$bgcolor = $xls->colors[$xls->bgColor($y,$x,$sheet)];
which is not covered in the docs.
Fluffeh, has got a good point. I assume the problem is in the version of php-excel-reader
you downloaded, it is sure out of date or it is prior the version 2.2.
So go to https://code.google.com/p/php-excel-reader/downloads/list and download the latest version to get that function in production. :)
Also in the version 2.21 it looks like this:
Also in the version 2.2 it looks like this:
I hope it will help also somebody :). Happy programming.