<%
response.setContentType(“application/vnd.ms-excel”);
response.addHeader(“Content-disposition”, “attachment; filename=export.xls” );
%>
<html xmlns:o=”urn:schemas-microsoft-com:office:office”
xmlns:x=”urn:schemas-microsoft-com:office:excel”
xmlns=”http://www.w3.org/TR/REC-html40″>
<head>
<style>
.numWithoutDec {mso-number-format:”\#\,\#\#0″;text-align:right;}
.numWith2Dec {mso-number-format:Standard;text-align:right}
.date {mso-number-format:”mm\/dd\/yyyy\;\@”}
</style>
</head>
<body>
<table x:str border=”1″>
<tr>
<th>String</th>
<th>Number 1</th>
<th>Number 2</th>
<th>Date</th>
</tr>
<tr>
<td x:str=”abcd”></td>
<td x:num=”12345.67″ class=”numWithoutDec”></td>
<td x:num=”12345.67″ class=”numWith2Dec”></td>
<td x:num=”36230″ class=”date”></td>
</tr>
</body>
</html>

Date number 36230 is the days between 01/01/1900 and 03/11/1999