• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Convertiing HTML to Excel format.

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I solved it by myself.
Thankx
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Vogen:
The code was very helpful!
^_^
------------------
Sun Certified Programmer for Java Platform
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic