[
https://issues.apache.org/jira/browse/ODFTOOLKIT-359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15124209#comment-15124209
]
Svante Schubert commented on ODFTOOLKIT-359:
--------------------------------------------
Sorry for the delay, I never felt responsible for the simple API layer, but it
seems an easy fix as Apache POI already has functionality to solve the above
problem, see
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.poi/poi/3.6/org/apache/poi/ss/util/CellReference.java#CellReference.convertColStringToIndex%28java.lang.String%29
If someone invest some time to create a test document (and/or full regression
test), I will invest some time to fix this
> setting data using a cell range address with two letters fails
> --------------------------------------------------------------
>
> Key: ODFTOOLKIT-359
> URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-359
> Project: ODF Toolkit
> Issue Type: Bug
> Components: java, simple api
> Affects Versions: 0.7-incubating
> Reporter: Michael Kabdebo
> Priority: Blocker
>
> I've created a table with a big number of columns (=144). Next next step was
> to generate a chart using the createChart(...)-method of the
> SpreadsheetDocument class.
> This is my cell range address: 'TableName'.A1:'TableName.EN4'
> I got this exception:
> not able to add chart for sheet 'TableName': For input string: "N4"
> java.lang.NumberFormatException: For input string: "N4"
> at
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
> at java.lang.Integer.parseInt(Integer.java:449)
> at java.lang.Integer.parseInt(Integer.java:499)
> at org.odftoolkit.simple.chart.DataSet.setValues(DataSet.java:596)
> at org.odftoolkit.simple.chart.DataSet.<init>(DataSet.java:123)
> at
> org.odftoolkit.simple.chart.AbstractChartContainer.createChart(AbstractChartContainer.java:133)
> at
> org.odftoolkit.simple.SpreadsheetDocument$ChartContainerImpl.createChart(SpreadsheetDocument.java:660)
> at
> org.odftoolkit.simple.SpreadsheetDocument$ChartContainerImpl.access$0(SpreadsheetDocument.java:658)
> at
> org.odftoolkit.simple.SpreadsheetDocument.createChart(SpreadsheetDocument.java:587)
> Whats happened:
> This is how you try to extract the column and row information:
> (DataSet.class:594 - 597)
> char beginColumn = begincell.charAt(0);
> char endColumn = endcell.charAt(0);
> int beginRow = Integer.parseInt(begincell.substring(1));
> int endRow = Integer.parseInt(endcell.substring(1));}}
> This won't work for addresses using column adresses with two letters (or
> more).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)