0

I want to write a value in Excel file, for example 0123456, when I open the excel file I can only get the value 123456; by default 0 is automatically truncated, even I used the below code:

$objExcelWriter->objPHPExcel->getActiveSheet()->getStyle('AM')->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_TEXT);

I want to display exactly the value 0123456, please help me to sort out this problem.

Cat
  • 66,919
  • 24
  • 133
  • 141
haisabari
  • 1
  • 2
  • Got solution in existing post: http://stackoverflow.com/questions/3054312/php-excel-correct-format-for-strings-numbers-beginning-with-zero – haisabari Nov 23 '12 at 05:30

1 Answers1

0
$objExcelWriter->objPHPExcel->getActiveSheet()->getStyle('AM')
    ->getNumberFormat()->setFormatCode('0000000');
Mark Baker
  • 209,507
  • 32
  • 346
  • 385