php - How to put 0001 in excel report using PHPExcel -


If I generate reports, there are problems with my code in PHPexcel. I have 0001 < There are numbers like / code>, 0002 , 0087 and when I move it to Excel, output to create a report is 1 , 2 , 87 . Why is it like this?

Values ​​are passed to generate excel reports using my var PHPExcel

  $ aic = isset ($ _ POST ['aic'. $ N])? $ _POST ['aic' $ N]: ""; I think the trick should be to set your cell format to a 4 digit number. I try it:  
  $ objPHPExcel-> GetActiveSheet () - & gt; GetStyle ('A1') - & gt; GetNumberFormat () - & gt; SetFormatCode ('0000');  

Comments