Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to export data to Excel

 
Ramakrishnan Ponmudi
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In core java, how to export data to MS-EXCEL
 
Steven Bell
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Learn the excel file format, construct a properly formed file in a byte[], and write it out to a file.

Or you might want to look at a third party library like poi.

There may be a way through ODBC, but I've never tried it and you still might need some additional library.
[ May 26, 2005: Message edited by: Steven Bell ]
 
Joe Ess
Bartender
Pie
Posts: 9265
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've had success creating a comma-seperated text file and naming it something.csv. Excel is associated with the CSV extension so it will open the file if you click on it in Windows Explorer.
 
Mark Wuest
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ramakrishnan:
In core java, how to export data to MS-EXCEL


I've had Excel-lent (sorry!) success with the already-mentioned jakarta poi hssf project. Go get poi. There's working sample code in the docs.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic