I am currently writing excel(.xls) files using xml and would like to format the cells so that when the file is opened the cells are already formatted.Does anybody out there know how this is done
Expand|Select|Wrap|Line Numbers
- $data = "
- <?xml version='1.0'?>
- <?mso-application progid='Excel.Sheet'?>
- <Workbook xmlns='urn:schemas-microsoft-com:office:spreadsheet' xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns:ss='urn:schemas-microsoft-com:office:spreadsheet' xmlns:html='http://www.w3.org/TR/REC-html40'>
- <Worksheet ss:Name='Investors'>
- <Table>
- ";
- $x = 0;
- for ($x = 0; $x < $resultCounter; $x++){
- $data .= "<Row>";
- $data .= "<Cell><Data ss:Type='Number'>".$numericField[$x]."</Data></Cell>";
- $data .= "<Cell><Data ss:Type='String'>".$StringField[$x]."</Data></Cell>";
- $data .= "</Row>";
- }
- $data .= "</Table></Worksheet></Workbook>";