Hi,
I am using aspose cells for java 7.2.2.1. I have an issue where in the following code runs just fine in in collegue’s machine but not mine. Both of us use the same aspose jars/license, same os, same os type. Can you please let me know how can I probably get rid of this? Attached the file that I am using.
Below is my machine details :
Aspose Cells version - 7.2.2.1
Jdk - 1.6
Os: Win 7 64 bit
Code:
public void testFromFile() {
try {
Workbook workbook = new Workbook(“C:/Pravat/Test/myFile.xlsx”);
Worksheet worksheet = workbook.getWorksheets().get(“Report”);
int count = worksheet.getCharts().getCount();
Chart chart = worksheet.getCharts().get(0);
ImageOrPrintOptions imgOpts = new ImageOrPrintOptions();
imgOpts.setImageFormat(ImageFormat.getJpeg());
//Save the chart image file.
chart.toImage(new FileOutputStream(“C:\Pravat\Test\MyChartImage.jpeg”), imgOpts);
} catch(Exception e) {
e.printStackTrace();
}
}
Exceprion that I get is :
java.lang.ArrayIndexOutOfBoundsException: 0
at sun.font.ExtendedTextSourceLabel.createCharinfo(Unknown Source)
at sun.font.ExtendedTextSourceLabel.getCharinfo(Unknown Source)
at sun.font.ExtendedTextSourceLabel.getLineBreakIndex(Unknown Source)
at java.awt.font.TextMeasurer.calcLineBreak(Unknown Source)
at java.awt.font.TextMeasurer.getLineBreakIndex(Unknown Source)
at com.aspose.cells.b.a.b.d.a.c.n(Unknown Source)
at com.aspose.cells.b.a.b.d.a.c.k(Unknown Source)
at com.aspose.cells.b.a.b.i.a(Unknown Source)
at com.aspose.cells.b.a.b.i.a(Unknown Source)
at com.aspose.cells.zc.a(Unknown Source)
at com.aspose.cells.mK.b(Unknown Source)
at com.aspose.cells.mK.b(Unknown Source)
at com.aspose.cells.mK.a(Unknown Source)
at com.aspose.cells.bQ.a(Unknown Source)
at com.aspose.cells.bQ.b(Unknown Source)
at com.aspose.cells.cD.aj(Unknown Source)
at com.aspose.cells.B.t(Unknown Source)
at com.aspose.cells.B.p(Unknown Source)
at com.aspose.cells.cG.a(Unknown Source)
at com.aspose.cells.Chart.toImage(Unknown Source)