Reply to output to spreadsheet - how to use format?

Your name:

Reply:


Posted by Paul on 06/07/07 23:33

I use OpenOffice but I suppose similar formatting rules apply to MS Excel.
For example, to format a cell for two digit numbering, the format code is:

#,##0.00

I can use formulas (=F$temp + 5) and there's likely a way to write
formatting strings in the output code, I just need a little help. Any
ideas?

My code is fairly typical to export to spreadsheet:
//get data from database
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"my-data.xls\"");
$data = "";
$temp = 0;
foreach($r as $row) {
$temp++;
$data .= $row['data1'].",".$row['some_number'].",=F$temp + 5\r\n";
};
echo $data;

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация