• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Conversing the result set data into XLS

 
Buddha Raju
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all.
I need to read the data from Oracle DB and display the results in the xls and i need to save this generated xls report into the in one more table.
If any body had code for Conversing the result set data into XLS (Excel) report. Please let me know how to do,
It will be great help for me if you send the code

Regards
Raja
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34965
377
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raja,
Welcome to JavaRanch!

An Excel file is just a comma delimitted file (unless you need formatting.) You just have to loop through the ResultSet and write out each line separating the fields with commas.

If you need formatting, take a look at Apache's HSSF.
 
Buddha Raju
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IF you have some code can you send the code.

raja
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Raju Buddha",

There aren't may rules that have been put into place here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
Buddha Raju
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Bear
My first name is raju and last name is buddha. That's why i have used display name as buddha raju,
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for your problem download datafile.jar from sourgeforge.net

It has pretty good handling for excel and csv, also javadocs were there on the site but i could not find the url

you can download datafile.jar from
here

Shailesh
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is url you can download jar file and javadocs from here

http://datafile.sourceforge.net

use its api's to generate excel files

Shailesh
 
Buddha Raju
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Shailesh
Do you have any code to read the data from DB and generate the XLS report from the ResultSet



Raj
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would recommend to read javadocs provided by API, If you face any problem then many ranchers are here

here is the code for your help I picked from same api's doc, coz I used this api once for reading only

you can change for loop to your resultset's while loop




Shailesh
[ June 08, 2005: Message edited by: Shailesh Chandra ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic