Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

writing excel through java

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 32
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a bad idea:


catch(Exception e){}


How will you what problems there are?
 
supriya lal
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou Mark it worked
 
supriya lal
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes I never use catch(Exception e)... It was for the example..thankyou
 
He's giving us the slip! Quick! Grab this tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!