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

Create a copy of excel work sheet using POI

 
Sylvia Crissy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Is there any method to create a copy(save as) of an existing excel worksheet using POI api.

Kindly help with some sample programs.

Thanks in advance
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you want to use POI for this? Using File, FileInputStream and FileOutputStream is sufficient.
 
Sylvia Crissy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,
I need to read an excel sheet.


Thanks
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just about every possible operation is shown with examples in the POI documentation, including opening an XLS file, accessing a sheet, creating a new workbook and sheet, and saving it. Does that cover what you need to do?
 
Paul Michael
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf is right, if you just need an exact copy of the file, you can simply use java.io.

But if you need to read the contents and make some modifications before making the copy, then you will have to work with POI or JExcel.

I strongly suggest that you checkout JExcel. Its API to read excel documents is much simpler (IMO).

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic