Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • 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 ...
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Coping a chart from one Excel to another using POI.

Ranch Hand
Posts: 607
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All...

I am trying to copy a Chart from one Excel to another using HSSF POI. Here is what I been trying out ...

My question in particular is how does the chart.createBarChart work? Does it allow you to create a new chart in any document or only in that document from which the chart object (chartList) has been retrieved.

BTW - The above code throws me an null pointer exception when I try to write the excel using tempWB.write(out);

I got a second question - Is there any way to just copy an entire sheet in POI from one work book to another. Currently I am reading each cell - determining its type - copying the style and so on. Is there any way to just copy the entire sheet as is without bothering what its content is?
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic