Jump to content

Generate excel reports


ainoy31

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.