tags:

views:

1292

answers:

4

I am using POI API to read a template n to create an XLS file through java.

I want to get the chart from the template. IS there any way to do so?

A: 

Do you mean a way to get a GIF or JPEG? Actuate e.Spreadsheet can create images from Excel charts and ranges, but it's expensive (I worked there until 2002 but have no affiliation now).

Joe Erickson
A: 

If you build the chart into the template it will automatically update when you insert data into the spreadsheet.

If you are wanting to create a chart from scratch I believe that this functionality is not yet available in POI.

from the POI site:

You can not currently create charts. You can however create a chart in Excel, modify the chart data values using HSSF and write a new spreadsheet out. This is possible because POI attempts to keep existing records intact as far as possible.

POI Limitations

DMMcKinnon
+1  A: 

Maybe Andy Khan's JExcel can help you. It's a terrific tool. I much prefer it to POI.

duffymo
A: 

// officetools.jar available at http://www.dancrintea.ro/xls-to-pdf/

import officetools.OfficeFile;

FileInputStream fis=new FileInputStream(new File(”test.xls”));

OfficeFile f=new OfficeFile(fis,”localhost”,”8100″, false);

// read a column for(int i=0;i<=99;i++) System.out.println( f.getCell(1,i) );