• 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

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: 22781
131
Eclipse IDE Spring VI Editor 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: 22781
131
Eclipse IDE Spring VI Editor 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic