Free Support Forum - aspose.com

Problems with dataranges

Hi!

I’m using Aspose.Cells 2.2.1.1 for Java.

I get an exception for “Invalid data area” when I use:

Chart chart = sheet.getCharts().addChart(ChartType.PIE, x, y, x+width, y+height);
chart.getNSeries().add(dataRange, true);

java.lang.IllegalArgumentException: Invalid data area[Results(Kaikki)!D2:D4].
at com.aspose.cells.NSeries.a(Unknown Source)
at com.aspose.cells.NSeries.a(Unknown Source)
at com.aspose.cells.NSeries.add(Unknown Source)
at com.sonecta.export.excel.ChartSheet.addChart(ChartSheet.java:107)


but when I change the data area name to, for example, “Results#Kaikki#!D2:D4”, it works OK. It seems that adding whitespace or some special characters (e.g. ( ) characters) to the area name causes this exception.

Is this as designed, or is this a bug?

Best regards,

Tuomas Hynninen
Sonecta Ltd.

Hi Sonecta,

I have found the issue after an initial test, we will figure it out soon.

Your issue has been logged into our issue tracking system with an issue id: CELLSJAVA-17112. We will let you know once it is sorted out.

Thank you.

Hi,

After further looking into it, we found it is not an issue, you should add the nseries data range in this way:

NSeries nSeries = chart.getNSeries();
nSeries.add("=‘Results(Kaikki)’!D2:D4",true);

it will work fine as we tested.

Thank you.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan