With PHPExcel, I\'m using:
$workSheet->fromArray($array)
;
To set my data. However, one column needs to be set as string (a number with a leading
There is currently no method in PHPExcel that will allow you to set the data type for a range of cells, only for an individual cell.
There are a couple of options... the harder would be to write a custom Cell Value Binder that automatically sets the data type for those cells to string when the cell value is set by fromArray().
What you could do instead (and is far easier), is to leave the datatype as a number, and the value as a numeric, but to set a number format mask which tells Excel to display the numbers with leading zeroes.
$objPHPExcel->getActiveSheet()->getStyle('L3:N2048')
->getNumberFormat()->setFormatCode('0000');