Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convertiing HTML to Excel format.

 
Yogen Vadnere
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I solved it by myself.
Thankx
 
Stephen Wei
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
jayram
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please send me the solution. I am having the same problem
Regards
Jayram
 
Yogen Vadnere
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Vogen:
The code was very helpful!
^_^
------------------
Sun Certified Programmer for Java Platform
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic