How creating an Excel file for Excel 2010.

Creating an Excel file in Servoy out of en html

var _tempFiel = plugins.file.createTempFile(‘myTempFile.xls’);
plugins.file.writeTXTFile(_tempFiel, _output.toXMLString(), null, "application/msexcel");
plugins.file.writeFile(globals.output_filename, _tempFiel.getBytes());

This works fine whit Excel 2007
Bud it doesn’t in Excel 2010

Dos anybody have an idea, how it would also run in Excel 2010?

in the _output I have html information, something like this:

<html>
  <body>
    <table>
      <tr>
        <td>Bez</td>
        <td>Jan 2011</td>
        <td>Feb 2011</td>
        <td>März 2011</td>
        <td>Apr 2011</td>
        <td>Mai 2011</td>
        <td>Juni 2011</td>
        <td>Juli 2011</td>
        <td>Aug 2011</td>
        <td>Sept 2011</td>
        <td>Okt 2011</td>
        <td>Nov 2011</td>
        <td>Dez 2011</td>
        <td>TOTAL </td>
      </tr> 
      <tr>
        <td>Test</td>
        <td>833.25</td>
        <td>833.25</td>
        <td>833.25</td>
        <td>833.25</td>
        <td>833.25</td>
        <td>916.575</td>
        <td>916.575</td>
        <td>916.575</td>
        <td>916.575</td>
        <td>916.575</td>
        <td>916.575</td>
        <td>916.575</td>
        <td>10582.275</td>
      </tr>
    </table>
  </body>
</html> {0:<html>
  <body>
    <table>
      <tr>
        <td>Bez</td>
        <td>Jan 2011</td>
        <td>Feb 2011</td>
        <td>März 2011</td>
        <td>Apr 2011</td>
        <td>Mai 2011</td>
        <td>Juni 2011</td>
        <td>Juli 2011</td>
        <td>Aug 2011</td>
        <td>Sept 2011 </td>
        <td>Okt 2011</td>
        <td>Nov 2011</td>
        <td>Dez 2011</td>
        <td>TOTAL</td>
      </tr>
       <tr>
        <td>Test</td>
        <td>833.25</td>
        <td>833.25</td>
        <td>833.25</td>
        <td>833.25</td>
        <td>833.25</td>
        <td>916.575</td>
        <td>916.575</td>
        <td>916.575</td>
        <td>916.575</td>
        <td>916.575</td>
        <td>916.575</td>
        <td>916.575</td>
        <td>10582.275</td>
      </tr>
    </table>
  </body>
</html>}

What error do you receive? Maybe would be better to write in CSV format ?

Excel standard XLS mime-type is ‘application/vnd.ms-excel’ - you should change this.

If still not working, maybe you could try an XLSX extension and set the mime-type to ‘application/vnd.openxmlformats-officedocument.spreadsheetml.sheet’?