Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

copy workbook(xls) using xls

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if workbook1 contains pattern in some cell then in the copy workBook that pattern is getting copied
but pattern color is not getting copied.

Please see the code below.

File file = new File("C:\\New Microsoft Excel Worksheet.xls");
File file2 = new File("C:\\test1.xls");
Workbook workbook1 = Workbook.getWorkbook(file);
WritableWorkbook copy = Workbook.createWorkbook(file2, workbook1);

Please help me.

 
Sheriff
Posts: 22796
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which library are you using? I don't recognize class Workbook, and I think there are not a lot of people who do.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Prime wrote:Which library are you using? I don't recognize class Workbook, and I think there are not a lot of people who do.


Apache POI HSSF: http://poi.apache.org/apidocs/org/apache/poi/hssf/model/Workbook.html

Which is one of the most commonly used Java APIĀ“s for Excel though.
 
Rob Spoor
Sheriff
Posts: 22796
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I always used the usermodel subpackage, not the model. That one includes HSSFWorkbook, so that's why I didn't recognize it.

I think the Other Open Source Software forum will get some more reponse.
 
Rahul Dhaware
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using jxl lib files.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic