[ 
https://issues.apache.org/jira/browse/ODFTOOLKIT-471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16360566#comment-16360566
 ] 

Svante Schubert commented on ODFTOOLKIT-471:
--------------------------------------------

IBM has created the Simple API, but abandoned support, so if you desire a fix 
you might need it to do it yourself. That's the thing about open source, it is 
free, but the service is not necessarily included. You know the slogan: Improve 
the parts, that are itching you. :)

 

1) You get the latest sources. See 
http://incubator.apache.org/odftoolkit/source.html

 

2) There will be the need for a regression test, so best starting taking a look 
at the existing ones. If you search for 'setFormatString' in 

<YOUR_ODFTOOLKIT_DIR>/simple/src/test

You find a lot of occurrences in this class:

<YOUR_ODFTOOLKIT_DIR>/simple/src/test/java/org/odftoolkit/simple/table/TableCellTest.java
 

If you add your crash & "don't work" scenarios, you should be able to reproduce 
the problem.

 

If there are any further questions, do not hesitate to ask.

Good Luck,

Svante

 

> API crashes/fails to set the format string of a cell in scientific notation
> ---------------------------------------------------------------------------
>
>                 Key: ODFTOOLKIT-471
>                 URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-471
>             Project: ODF Toolkit
>          Issue Type: Bug
>          Components: simple api
>    Affects Versions: 0.6.2-incubating
>            Reporter: Enrico Scantamburlo
>            Priority: Major
>
> I need to create a ods document using the Apache ODF Toolking and to format 
> the content of its cells.
> I was able to set a format for dates and simple numbers, but for some reason 
> when I try to format with scientific notation it does not work. It fails to 
> parse the string or it wraps the E00 into "E00"
> {code:java}
> Row numRow = rows.get(1);
>  numRow.getCellByIndex(0).setDoubleValue(9.12345678);
>  numRow.getCellByIndex(0).setFormatString("0.000"); // works
>   //numRow.getCellByIndex(0).setFormatString("0.00E+00"); // crashes
>   //numRow.getCellByIndex(0).setFormatString("0.00E00"); // does not work, it 
> becomes 0.00"E00"
> {code}
> I also posted a question [ here | 
> [https://stackoverflow.com/questions/48709473/formatting-cells-with-apache-odf-toolkit-simple-api-and-java]
>  ]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to