tags:

views:

53

answers:

1

I have to Export data to xlsx, where the exported file should be in a pre defined format. Becoz of these i am using "PHPexcel". And i created a template of some format with each row with some specified height.

Actually in each cell i will be writing the data dynamically. so if the text is larger, then the row height in not increased.

So is ther anyway so tat row height is increased to fit the cell text.

+1  A: 

To set a row to autofit:

$objPHPExcel->getActiveSheet()->getRowDimension(10)->setAutoSize(true);

And then set the individual cells to allow wrapping

$objPHPExcel->getActiveSheet()->getStyle('A10:D10')->getAlignment()->setWrapText(true);
Mark Baker
thanks Mark. Its working...
sandeep
Hi Mark,how to specify the min height of row. For Ex if i don hav any data in all the cells in the row, in this case it should have some specified height. i mean each row shld hav min heigth.
sandeep
PHPExcel doesn't allow you to specify a minimum height... only an absolute height, or autofit
Mark Baker