ainoy31 Posted April 18, 2008 Share Posted April 18, 2008 Hello- Has anyone experience with the Spreadsheet Excel Writer class? I am generating a report in excel. In the report I have a column with zip codes. The problem is that when I have a zip code with leading zero, the zero gets remove automatically. I have tried the following code: $zipcode =& $xls->addFormat(); $zipcode->setNumFormat(9); //this is to format as type text or have tried 49 Then I have used the following code: $sheet->writeString($rownum, $colnum, $f, $zipcode); Let me know if this makes sense. Much appreciation. AM Link to comment https://forums.phpfreaks.com/topic/101737-generate-excel-reports/ Share on other sites More sharing options...
Zhadus Posted April 18, 2008 Share Posted April 18, 2008 Zipcode is a special format in excel and I'd imagine so in the writer class. If you're doing 9 digit zipcodes, the category in excel is Special and the type is "Zip Code + 4". Hopefully that will help you out, I'm not familiar with the excel writer class itself. Link to comment https://forums.phpfreaks.com/topic/101737-generate-excel-reports/#findComment-520539 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.