Generating Excel Files With JSP
When browsing through the web, sometimes, you might see web pages which generate and show reports in MS Excel file format. If you are a web developer, you might be aware of how to do this or you might be lost in web searching for a method to get this done. If you belongs to the second set, then you are now in the right place. If you know what JSP is and how to setup a server like Apache Tomcat and familiar with HTML, then it's more than enough for you to get this done. All you have to do is, putting the following line of code in you JSP page, right before the BODY tag.
< %
response.setContentType("application/vnd.ms-excel");
% >
**Note that the server must have MS Excel installed in it.
After putting the above lines of code, jsut proceed with your usual HTML coding.
When requesting your page from the server, it'll not be a HTML page anymore... It'll be a MS Excel Document!..
Bravo!
/Cheers,
-MadGuy
< %
response.setContentType("application/vnd.ms-excel");
% >
**Note that the server must have MS Excel installed in it.
After putting the above lines of code, jsut proceed with your usual HTML coding.
When requesting your page from the server, it'll not be a HTML page anymore... It'll be a MS Excel Document!..
Bravo!
/Cheers,
-MadGuy

0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home