Adding a comment with right aligned text inside ?

Topics: Developer Forum, User Forum
Jan 19, 2011 at 9:31 AM

Hey all,

can you tell me if it is possible to place a comment and make it right aligned ? :

$objPHPExcel->getActiveSheet()->getComment('A1')->getText()->createTextRun("text string here");

$objPHPExcel->getActiveSheet()->getComment('A1')->getText()->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);  << return error, is there a way to do it right ?



Thx all for reading, PHPexcel is awesome !

Jan 19, 2011 at 11:33 PM
Edited Jan 19, 2011 at 11:41 PM

I don't believe we can actually set alignment for cell comments in PHPExcel, although I know that Excel itself does support this. I'll need to read the specs to see how this information is actually stored in the workbook, add appropriate properties and methods to the PHPExcel_Comment class, and modify the readers and writers to support it.


Note that, when implemented, this will be applied as:




because alignment is a property of the comment object, not the actual text.

Defaults for comments should be HORIZONTAL_LEFT and VERTICAL_TOP

Jan 19, 2011 at 11:34 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.