Is this still a web application? You really mean they will download the excel files right?
A very simple way is to output a content type of Content-Type: application/vnd.ms-excel and an HTML table and then if your clients are using IE and Excel it will load that as an excel sheet. You can even have formulas in this. It's really quite simple.
I write this code file is copied to client computer but it gives error in opening
My code is
ServletOutputStream out = null;
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment; filename=sample.xls");
FileInputStream f=new FileInputStream("c:\\sample.xls");
FileChannel fc=f.getChannel();
try
{
byte[] data = new byte[(int)fc.size()];
out = response.getOutputStream();
out.write(data);
}
catch(IOException e){}
finally
{
if(out != null)
{
try
{
out.flush();
out.close();
}
catch(IOException e){}
}
}
Thanks d17may