Excel5 reader and rich text?

Topics: Developer Forum
Feb 2, 2012 at 6:50 PM
Edited Feb 8, 2012 at 1:50 PM

Hello everybody,

First, excuse my english please. Beside, I was wondering if there is a way to read rich text from XLS files using PHPExcel?

In fact, I have to distinguish different font styles into one cell, to keep, for instance bolded string or string with different color. Is it possible with an Excel5 reader object?

 

Best regards,

Laurent

Feb 8, 2012 at 1:49 PM
Edited Feb 8, 2012 at 1:50 PM

Ok, for anyone interested I had troubles with rich texts because of this line :

$objReader->setReadDataOnly(true);

Once set to false I've treated rich text elements one by one like this:

foreach ($cell->getValue()->getRichTextElements() as $element) {
     if (!is_null($element->getFont()) && !$element->getFont()->getBold()) {
       // treatment
     }
}

 

Best regards,

Laurent