📜  Laravel Excel 数字格式化为文本仍然显示为数字 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:20.749000             🧑  作者: Mango

代码示例1
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 ;)