• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java + Excel and Word files

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

I have to be able to read in an Excel file, I was wondering what the best approach is? I have read people that use JDBC and some that use POI. For what I saw of POI it was only good for Excel 97-02. I also have to read in a Word file that contains images. Does Java have something that can read Word files in also. One more I might also have to convert a Word file to HTML does Java have a solution for this?

Any thought?

Thanks,

Jutah
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the Jakarta POI supports reading and writing into Word files as well. Go through <a href="http://jakarta.apache.org/poi/">this link</a>
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
POI supports Word files, but only in a very basic way (yet). It can extract text from DOC files, but not images.

I'm not aware of any Java library that can convert DOC to HTML. You could try OpenOffice, which can open DOC files, and which has a Java API. Some information about that is linked here.

Update: Looks like I spoke too soon. There's now a 3.0 alpha version which seems to have the necessary classes and methods to extract images from DOC files. Have a look at the getPicturesTable method in HWPFDocument.
[ January 09, 2007: Message edited by: Ulf Dittmer ]
 
Andrew Mcmurray
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys so POI is probably the way to go?

AMD
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. For Excel it works very well. If it doesn't do what you need to do with Word files, look into OO.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you can get the Word file saved in .rtf format it might be easier to manipulate. Since Open Office can read most word files and write XML it may be your best choice - and of course the price is right.

Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic