Forums Register Login

displaying the data from oracle in excel sheet

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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)
+Pie Number of slices to send: Send
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
Wait for it ... wait .... wait .... NOW! Pafiffle! A perfect tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1081 times.
Similar Threads
Oracle 9i to Excel Sheet
Uploading and downloading data from excel sheet
handling excel sheet with java
populate data from csv into oracle
Using JDBC to insert into MS Excel file
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:20:00.