Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language:
Expertise: Intermediate
Jun 17, 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.

MS Sridhar
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap