I have to create stand out sheet from the Java code which consists of charts like Bar chart, Line Chart etc while using Apache POI library. Is it feasible? I'm not capable of finding any helpful code example for the similar.

Can there be every other alternative with this aside from POI library for Java?

Thanks ahead of time, Abhinav Mishra

Can there be every other alternative with this aside from POI library for Java?

You will find a couple of other libraries too, but I am unsure when the can write this type of factor just like a chart.

If you're able to make use of the more recent Office versions (those that make use of the XML based format files), than you could utilize another approach:

  • produce a an Stand out file having a more recent version of Office, that contains the charts you'll need, plus some dummy data.
  • unzip that stand out file and extract the XML files from the inside. On most interest would be the files xlworksheetssheet1.xml xlworksheetssheet2.xml or xlworksheetssheet3.xml (based on what sheets were utilised)
  • Have a look in the extendable (it's more difficult than using POI), however it should not be very difficult to recognize the "dummy" data you joined before.
  • Use Velocity or FreeMarker to change that xml file right into a template (by changing your dummy data with variables and macros an amount make the same result)
  • Write a little program (only a couple of lines) that can take you real data, merges using the template, and packs everything in a zip, but puts the *.xlsx extension.

I understand the above steps look just a little complicated, but when you do not have too complicated Stand out files, it ought to be simpler of computer looks.

You are able to just use Stand out template to preserve chart with POI. It mean you create an Stand out template file with chart inside it and link the chart's datasource to 1 definedName,you'll be able to load web site file from POI and taking advantage of code to alter the definedName. Current POI doesn't support to produce Chart on your own.

This is very complicated to complete on your own, as you'll have to evaluate which must use the Stand out file to produce the charts. I'd go another route.

Create an Stand out file which includes a macro that produces the Bar Chart etc for many data (using Stand out within the usual way). Then use Apache POI to produce a file using the data you would like and begin Stand out from Java, performing the macro that produces the charts.

The thread looks old and I don't know for those who have already determined a means or continue to be searching for one.

But here's what I'd do. There's a totally free library known as JFreeChart. You should use that to create whether Digital or PNG file which you'll then place into stand out file whenever you create it with Apache POI.

However the disadvantage with this particular method would be that the data within the graph won't change dynamically whenever you alter the data within the spreadsheet out of the box the situation with Stand out. Now that's something I am unable to accept.

So I am likely to do your homework now. I am confident that because the question continues to be requested there has to be an addition of the feature in Apache POI or any other elegant method of doing things. Basically find any I'll be certain to publish my findings here.

---- UPDATE ----

During my research lasting for around an hour, I possibly could only locate one appropriate library known as SmartXLS (please google it, I possibly could not publish the hyperlink because i am a newbie and also the junk e-mail prevention mechanism started in) that's remotely near to things i would use. You will get both stand out and also the chart using a program. The web site really is easy and that i couldn't find any certification information so I am presuming it's free for private and commercial use. I could download the library with no problem. I haven't tried on the extender yet. Try it out and tell us the way it calculates.