Search
 
SCRIPT & CODE EXAMPLE
 

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 ;)
Comment

PREVIOUS NEXT
Code Example
Php :: ternary operator for three conditions in php 
Php :: Woocommerce remove add to cart message 
Php :: carbon get day name from date 
Php :: php artisan orderByDesc 
Php :: laravel set session timeout 
Php :: how to insert multiple selected 
Php :: adding days in datetime php 
Php :: wordpress custom php use wp query 
Php :: laravel pagination keep query string 
Php :: carbon subdays 
Php :: php code to generate strong password 
Php :: php laravel config 
Php :: updateorcreate laravel 
Php :: laravel select selected 
Php :: php usort method of class 
Php :: multiple routes same controller laravel 
Php :: how unique field in table in phpmyadmin 
Php :: php post request 
Php :: destory session in laravel 
Php :: resource controller artisan command 
Php :: drupal 8 twig add id 
Php :: Update Query in Codeigniter Using Multiple Where Condition 
Php :: count an array in php 
Php :: wordpress post types supports thumbnail 
Php :: add execute time php 
Php :: model with migration laravel 
Php :: php code for video upload 
Php :: php location header 
Php :: cviebrock/eloquent-sluggable 
Php :: DateTime and Timestamps 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =