• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

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: 22862
132
Eclipse IDE Spring TypeScript Quarkus 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: 22862
132
Eclipse IDE Spring TypeScript Quarkus 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic