Incorrect property when reading formatted text

Topics: Developer Forum, User Forum
Jun 10, 2011 at 1:42 PM

Hi Folks,
I'am not sure if i'am doing sometihng wrong, but i can't just make it to work.. All i want it's to get the text style like font, color, size, italiq, bold etc.
I use this

$objWorksheet->getStyle("A.1")->getFont();

 

But this return _bold : FALSE, _italiq: FALSE etc  when all of these are in fact TRUE

 

What i'am doing wrong?


Also how to do that at the cell level?

 

foreach ($objWorksheet->getRowIterator() as $row)
                    {
                        $cellIterator = $row->getCellIterator();
                        $cellIterator->setIterateOnlyExistingCells(false);
                        foreach ($cellIterator as $cell)
                            {
                                $cel_val= $cell->getValue();
                                $cel_font = $cel-> ?????
                            }

                    }

i know i can use $objWorksheet->getStyle("A.1") and replace the coordinates, but is there a better way using the $cell object?


Thank you for the help!

 

Dec 26, 2011 at 4:42 PM
Edited Dec 26, 2011 at 4:42 PM

I also try to read the font format (bold, size) from Excel5 file, but at this time unsuccessfully.

nicuuul, have you already solved this issue?

Coordinator
Jan 2, 2012 at 11:03 AM

"A.1" is not a valid cell address, try "A1"

$objWorksheet->getStyle("A1")->getFont();