Formating Columns

Topics: Developer Forum
Mar 15, 2013 at 11:36 PM
Hello,

when I'll have following values in column "A" 0000123456 PHPEXCEL cut it to 123456 how I can solve this that the values are transfer exactly without cut.

Best Regards,
Frank
Mar 19, 2013 at 6:45 AM
Like in Excel : a Number Format with plenty of zero ($worksheet->getStyle('A1')->getNumberFormat()->setFormatCode('0000000000')) or writing your cell as string ($worksheet->setCellValueExplicit('A1',$Value)).

Note : $worksheet=$objExcel->getActiveSheet();
The third optional parameter for setCellExplicit as a default value of PHPExcel_Cell_DataType::TYPE_STRING
Mar 19, 2013 at 5:30 PM
Hello LWol,

thanks the third solution is perfect for me.
Now the values are with 0000.... in the columns.

Thank you very much for your help.

Best Regards,
Frank