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 zero, the leading zero gets cut off if not set to string). If I wasn't using the fromArray
method, I could set the data type using PHPExcel_Worksheet::setCellValueExplicit()
.
However, I want to do this using a range of columns. Ideally something like this:
$worksheet->getCell('A1:A50')->setDataType(PHPExcel_Cell_DataType::TYPE_STRING);
But looking at the code, getCell
won't allow a range, only a single cell. How can I do this?