File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes how to export data to Excel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to export data to Excel" Watch "how to export data to Excel" New topic
Author

how to export data to Excel

Ramakrishnan Ponmudi
Ranch Hand

Joined: Apr 20, 2004
Posts: 72
In core java, how to export data to MS-EXCEL
Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
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

Joined: Oct 29, 2001
Posts: 8877
    
    8

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Mark Wuest
Ranch Hand

Joined: Jun 07, 2003
Posts: 88
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to export data to Excel