Pratial Bold

Topics: Developer Forum, Project Management Forum, User Forum
Nov 1, 2010 at 2:08 AM

How to achieve partial bold in the cell?

 

Say, there is a text in Cell A1

Abcdefghijklmn

in the above text d is bold. how to achieve this?

 

Please let me know..

Coordinator
Nov 1, 2010 at 10:21 PM
Edited Nov 2, 2010 at 12:06 AM

Take a look at Rich Text Runs in the documentation (section 4.6.38), and in the Feature Demo (05featuredemo.inc.php) in the /Tests subdirectory.

 

$objRichText = new PHPExcel_RichText();
$objRichText->createText('abc'); 
$objBolded = $objRichText->createTextRun('d'); 
$objBolded->getFont()->setBold(true); 
$objRichText->createText('efghijklmn'); 
$objPHPExcel->getActiveSheet()->getCell('A1')->setValue($objRichText);
Nov 2, 2010 at 9:59 AM

Hey Mark,

Thank you for your reply.

 

The thing is I have downloaded all the examples available.

But this is interesting: I have examined and studied 05featuredemo.inc.php.  But it didnt help. The reason is, the excel5 it generates is not proper. when I generate this as 2007 version it work fine.

None of the Richtext is showing properly in excel5 version. The rotation also failed in excel 5. and I am talking about the provided test files not generated by me.

Please let me know what I am missing.

By the way this is a great software. I liked it

 

05featuredemo.inc.php
Coordinator
Nov 2, 2010 at 2:10 PM

Work Item 8916: rich text isn't supported in the Excel5 Writer (the Excel5 Reader does read it though)