How to activate wrap text on a cell

Topics: Developer Forum, User Forum
Nov 28, 2007 at 5:11 PM

I don't understand how to use text wrapping. I've got some cells where I must activate this function.

can you help me?

thank you

Nov 28, 2007 at 8:07 PM
Please check the API documentation for more information on text wrapping: PHPExcelStyleAlignment::setWrapText()
Nov 28, 2007 at 9:05 PM
yes, i saw that before

but how to use in my code

$objPHPExcel->getAlignment()->setWrapText($style->alignment"wrapText" == "true");
$objPHPExcel->getActiveSheet()->setCellValue('B1','nbr of accounts');
$objPHPExcel->getActiveSheet()->setCellValue('C1','having accessed');
$objPHPExcel->getActiveSheet()->setCellValue('F1','total nbr of orders');
$objPHPExcel->getActiveSheet()->setCellValue('H1','nbr of accnts ordering');

doesn't work, of course
where can I change de WrapText style ?

I don't find any general help for things like that with phpexcel, only long list like the previous link, where i understand nothing, sorry
Nov 29, 2007 at 9:57 AM
This API documentation is actually an overview of al lclasses and methods in PHPExcel.
You can see which classes are used in other classes, and deduct almost every possibility in PHPExcel.

Alignment can be set like this:
May 28, 2010 at 10:04 AM

Yes but with Excel 2000 setWrapText didn't work. I use Excel5.

I try $objPHPExcel->getActiveSheet()->getStyle('D12')->getAlignment()->setWrapText(true);

or $objPHPExcel->getActiveSheet()->getStyle('D12')->applyFromArray(
                        'font'    => array(
                            'size'        => 8
                                                'alignment' => array(
                            'wrapText' => true

When I open the generate file, the file is empty. It's possible for Excel 2000 ?

Sorry for my English