Akira Posted July 24, 2006 Share Posted July 24, 2006 Hey guys,Im trying to create a excel file from PHP and import this to Word.How can this be done??I've tried 2 different methods so far.1. genarating and XML file and saving it as Excel2. generating a full workbook, also with the help off XMLA piece of the code[code]<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"> <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> <WindowHeight>11910</WindowHeight> <WindowWidth>15195</WindowWidth> <WindowTopX>480</WindowTopX> <WindowTopY>60</WindowTopY> <ProtectStructure>False</ProtectStructure> <ProtectWindows>False</ProtectWindows> </ExcelWorkbook> <Styles> <Style ss:ID="Default" ss:Name="Normal"> <Alignment ss:Vertical="Bottom"/> <Borders/> <Font/> <Interior/> <NumberFormat/> <Protection/> </Style> </Styles> <Worksheet ss:Name="Blad1"> <Table ss:ExpandedColumnCount="10" ss:ExpandedRowCount="<?=count($_POST['id'])?>" x:FullColumns="1" x:FullRows="1"> <Column ss:Index="9" ss:Width="52.5"/> <Row> <Cell><Data ss:Type="String">voorletters</Data></Cell> <Cell><Data ss:Type="String">tussenvoegsel</Data></Cell> <Cell><Data ss:Type="String">achternaam</Data></Cell> <Cell><Data ss:Type="String">adres</Data></Cell> <Cell><Data ss:Type="String">huisnr</Data></Cell> <Cell><Data ss:Type="String">toevoeging</Data></Cell> <Cell><Data ss:Type="String">postcode</Data></Cell> <Cell><Data ss:Type="String">woonplaats</Data></Cell> <Cell><Data ss:Type="String">telefoon</Data></Cell> <Cell><Data ss:Type="String">e-mail</Data></Cell> </Row>[/code]But Word doenst see it as a legal document.Can someone help me with this, need to have this done by tonight 00.00 :| Quote Link to comment Share on other sites More sharing options...
lead2gold Posted July 24, 2006 Share Posted July 24, 2006 you might find it way easier to export it as a comma separated value (.csv) file.there is a great tutorial on how to do this on this site.It's the easiest format to open into excel with. Quote Link to comment Share on other sites More sharing options...
Akira Posted July 24, 2006 Author Share Posted July 24, 2006 yes, i know, thats not a problem. Already have the scripts for that ;) But i need to import it to Word.Otherwise i'll have 2 steps, instead of one. THnx for the reply btw Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted July 24, 2006 Share Posted July 24, 2006 I copied your sample and saved it as the file "test.xml". Both Excel 2003 & Word 2003 opened the file with no problems.How are you saving the file?Ken Quote Link to comment Share on other sites More sharing options...
Akira Posted July 24, 2006 Author Share Posted July 24, 2006 Get your freak on! Saved the file everytime as .xsl file :|Thnx bro, were gonna try that one! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.