In my webpage, I am using PHPexcel 1.8
to generate excel files. Now I am facing an issue which describes below.
I have some date values in the format dd/mm/yyyy
. The value is coming. But it shows with a single quote(')
at the begining.
I tried many solutions. But none helps me out.
My sample code portion is given below
$cnt = 1;
foreach($gluuidArr as $uuid){
$this -> excel_180->getActiveSheet() ->setCellValue('A'.$cnt,$aVal);
$this -> excel_180->getActiveSheet() ->setCellValue('B'.$cnt,$bVal);
$this -> excel_180 -> getActiveSheet() -> setCellValue('C'.$cnt, $cVal);
$this -> excel_180->getActiveSheet() ->setCellValueExplicit('D'.$cnt,$dVal, PHPExcel_Cell_DataType::TYPE_STRING);
$this -> excel_180 -> getActiveSheet() -> setCellValue('E'.$cnt, $eVal);
$cnt += 1;
}
where $aVal, $bVal,..
are declaring inside the loop and $eval
contains date in dd/mm/yyyy
format
suppose the date is 20/05/2016
, when click on the excel cell, it will show like '20/05/2016
I have tried
$this -> excel_180->getActiveSheet()->getStyle('E'.$cnt)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_DDMMYYYY);
But no luck.
Please help me to get rid of this issue. Any help could be appreciated.