This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes displaying the data from oracle in excel sheet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "displaying the data from oracle in excel sheet" Watch "displaying the data from oracle in excel sheet" New topic
Author

displaying the data from oracle in excel sheet

srinivas srini
Greenhorn

Joined: Feb 03, 2004
Posts: 23
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

Joined: Nov 22, 2008
Posts: 18944
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

Joined: Nov 19, 2002
Posts: 53
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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: displaying the data from oracle in excel sheet
 
Similar Threads
handling excel sheet with java
Oracle 9i to Excel Sheet
Uploading and downloading data from excel sheet
populate data from csv into oracle
Using JDBC to insert into MS Excel file