*
The moose likes Java in General and the fly likes writing excel through java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "writing excel through java" Watch "writing excel through java" New topic
Author

writing excel through java

supriya lal
Greenhorn

Joined: Sep 11, 2012
Posts: 15
hello... I am trying to read an excel file hello and add new cells in the end an then add data to it and save it.. but my following programme is not producing any output.please help
Mark Beardsley
Ranch Hand

Joined: Jun 07, 2013
Posts: 32
    
    1
My first observation is that you are using the wrong set of classes to handle the workbook. Excel workbooks come in two different formats; the older binary file format (.xls) and the newer OOXML format (.xlsx). From the code you posted, you would appear to be working with one of the newer format files - from the file extension .xlsx - and to do this with POI, you need to use the XSSF classes not the HSSF ones. Better still would be to use the classes in the unifying ss usermodel stream.

There are numerous examples on the POI website, http://poi.apache.org/spreadsheet/quick-guide.html
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41118
    
  45
This is a bad idea:

catch(Exception e){}

How will you what problems there are?


Ping & DNS - my free Android networking tools app
supriya lal
Greenhorn

Joined: Sep 11, 2012
Posts: 15
Thankyou Mark it worked
supriya lal
Greenhorn

Joined: Sep 11, 2012
Posts: 15
yes I never use catch(Exception e)... It was for the example..thankyou
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: writing excel through java
 
Similar Threads
Save File on Client Machine
opening the excel sheet from servlet
setShrinkToFit using POI
facing diffculty to highlight background color of an excel cell which is not reflected in file
How to make POI HSSF support Chinese Encoding?