This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

displaying the data from oracle in excel sheet

 
srinivas srini
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
im using servlets for fetching the data from oracle , i want to display the data which i get from orcle in excel sheet. A code snippet regarding this is highly appreciated...
Thanks in advance
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can check out the POI project from jakarta. With that you are able to create an excel sheet which you can send back to the client.
POI is only responsible for creating an excel file, then simply put it into
the response stream of the servlet or whatever you use. (Don't forget to set the response type)
 
Rafa Moreno
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Searching the same, sometime I found a place with some directions to do it:
1.- create a excel page
2.- save it as an htm document
3.- base the pages needed ond the page generated
I found that if the page is open on IE, it's opened like an excel page
some code
<%@ page contentType="application/vnd.ms-excel" %>
<html xmlns ="urn:schemas-microsoft-com ffice ffice"
xmlns:x="urn:schemas-microsoft-com ffice:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 9">
</head>
<body link=blue vlink=purple>
<table x:str border=0 cellpadding=0 cellspacing=0 width=240 style='border-collapse:
collapse;table-layout:fixed;width:180pt'>
<col width=80 span=3 style='width:60pt'>
<tr height=17 style='height:12.75pt'>
<td height=17 width=80 style='height:12.75pt;width:60pt'>Enero</td>
<td width=80 style='width:60pt'>Febrero</td>
<td width=80 style='width:60pt'>Marzo</td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 align=right style='height:12.75pt' x:num>100</td>
<td align=right x:num>150</td>
<td align=right x:num>250</td>
</tr>
<tr height=17 style='height:12.75pt'>
<td height=17 align=right style='height:12.75pt' x:num>150</td>
<td align=right x:num>280</td>
<td align=right x:num>300</td>
</tr>
<![if supportMisalignedColumns]>
<tr height=0 style='display:none'>
<td width=80 style='width:60pt'></td>
<td width=80 style='width:60pt'></td>
<td width=80 style='width:60pt'></td>
</tr>
<![endif]>
</table>
</body>
</html>
Try it
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic