aspose file tools*
The moose likes Servlets and the fly likes Convertiing HTML to Excel format. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Convertiing HTML to Excel format." Watch "Convertiing HTML to Excel format." New topic
Author

Convertiing HTML to Excel format.

Yogen Vadnere
Ranch Hand

Joined: Sep 20, 2001
Posts: 58
Hello All,
How to do the following ,
I am generating one report using jsp and at client side i want to convert that report into excel format(ofcourse after clicking button) and open the excel at client machine and show the report.
Thankx in advance.
Yogen


Yogen Vadnere
Yogen Vadnere
Ranch Hand

Joined: Sep 20, 2001
Posts: 58
I solved it by myself.
Thankx
Stephen Wei
Ranch Hand

Joined: Oct 09, 2001
Posts: 73
I am having the same problem.
Could you please give me some hints about how to do it? I know how to launch the excel application by JSP, but how do you enable excel to view the page in the correct format? How do you represent all your data in JSP? a couple of lines of sample JSP would be very helpful, thank!
------------------
Sun Certified Programmer for Java Platform


Sun Certified Programmer for Java Platform
jayram
Ranch Hand

Joined: Oct 30, 2000
Posts: 94
Please send me the solution. I am having the same problem
Regards
Jayram
Yogen Vadnere
Ranch Hand

Joined: Sep 20, 2001
Posts: 58
This is sample code...
Hope this will help u..
<br><br>
File : dispexcel.jsp<br>
<br>
<html>
<%
String convert = request.getParameter("go") ;
if(convert != null && convert.toUpperCase().equals("Y")){
response.setContentType("application/vnd.ms-excel");
}
%>
<table>
<tr>
<td>Name</td>
<td>Phone</td>
</tr>
<tr>
<td>Yogendra</td>
<td>513 674 7375</td>
</tr>
<tr>
<td>
<%
if(convert == null | | convert.toUpperCase().equals("N")){
%>
<form name=myform target="NEW" action=dispexcel.jsp >
<input type=submit value="convert to excel">
<input type=hidden value="Y" name=go>
<%
}
%>
</td>
</tr>
</form>
</table>
</html>
Stephen Wei
Ranch Hand

Joined: Oct 09, 2001
Posts: 73
Thanks Vogen:
The code was very helpful!
^_^
------------------
Sun Certified Programmer for Java Platform
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Convertiing HTML to Excel format.