Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Laravel Excel numbers formatted as text still appearing as number


I found a workaround by using setCellValueExplicit()
eg:

$sheet->setColumnFormat(array( //se formatea la columna a texto
    'C' => PHPExcel_Style_NumberFormat::FORMAT_TEXT,
    'I' => 'dd-mm-yyyy hh:mm'
));

$sheet->setCellValueExplicit('C10', $object->card_number, PHPExcel_Cell_DataType::TYPE_STRING);

Hope this helps ;)
 
PREVIOUS NEXT
Tagged: #Laravel #Excel #numbers #formatted #text #appearing #number
ADD COMMENT
Topic
Name
9+2 =