How to read xls diagram in java?

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

I want to get a chart from a template. Is there any way to do this?

+3
source share
5 answers

If you create a chart in a template, it will automatically update when you insert data into a spreadsheet.

If you want to create a chart from scratch, I believe that this function is not yet available in the POI.

from the POI website:

You cannot create charts at this time. However, you can create a chart in Excel, change the values โ€‹โ€‹of the chart data using HSSF and write a new table out. This is possible because POI attempts to keep existing records as possible.

POI

+1

Maybe Andy Khan JExcel can help you. This is an amazing tool. I prefer his POI.

+2
source

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

0
source
// 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));
0
source

Source: https://habr.com/ru/post/1702464/


All Articles