Eric Hartwell's InfoWeb

June 2004
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      
May   Jul


 Friday, June 18, 2004

Export HTML Data into Excel Files
Nowadays, many reports are generated as HTML documents for access on the Web. This tip shows you how to export that HTML data as it is (including all the CSS styles, tables borders, etc.) into an .xls file which can be saved and used as you need it. Include the following code in the .jsp page that generates the report/HTML page:

 String mimeType = "application/vnd.ms-excel";
 response.setContentType(mimeType);

The output is transferred to an .xls document.
Please Note: Microsoft Excel must be installed on the client's computer for this to work.
By MS Sridhar SridharMSmail@yahoo.com


8:44:02 AM