Style from array and XLSX problem

Topics: Developer Forum, User Forum
Mar 11, 2008 at 10:37 AM

i'm a newby and have some questions regarding to styling and create Excel 2007 Files.
I want to set wraptext and NUMBER-FORMATING by using an array but i didn't get it working.
Here is my Code:

$wertnormalcenterpercentage = array('font' => array('size' => 8),'alignment' => array('horizontal' => PHPExcelStyleAlignment::HORIZONTALCENTER, 'wraptext' => true),'borders' => array('right' => array('style' => PHPExcelStyleBorder::BORDERTHIN)), 'numberformat' => array('formatcode' => PHPExcelStyleNumberFormat::FORMAT_PERCENTAGE));

Next i used an Excel 2007 File as template. But when i'm inserting more then six rows to the first worksheet the Excel file will be damaged.
I want get any error during creation but Excel can't open it.

I'm using Excel 2003 with 2007 compatibility pack PHP 5.2.5 and set memory_limit to 512MB.

Kinde regards,

Mar 11, 2008 at 11:23 AM
Try something like:
		'numberformat'    => array(
			'code'      => PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE
		'alignment' => array(
			'wrap'       => true
Mar 11, 2008 at 12:33 PM
Thx for your quick help.
This was the solution.

The other problem could be solved by myself.

Kind regards,