Le 04/06/2013 11:20, Robin Naceur a écrit :
Good morning !

I am working on a project right now where I need to read ODS files in order
to store data in a database.

I download files from a french website (ODS Files) and I try to "parse"
them. However, for some files I have downloaded, it doesn't work when I try
to get the sheets.
I have been looking for a solution everywhere but I can't find anything. I
can't even find someone who has the same issue.

Here code line where it generates an exception  :
sheet = SpreadSheet.createFromFile(file).getSheet(2);

And below, a part of the exception generated.

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException:
Cannot change format version from
org.jopendocument.dom.XMLFormatVersion@ce6e6b3 OD version null to
org.jopendocument.dom.XMLFormatVersion@cfddf7f OD version 1.1
     at org.jopendocument.dom.ODPackage.checkVersion(Unknown Source)
     at org.jopendocument.dom.ODPackage.setTypeAndVersion(Unknown Source)
     at org.jopendocument.dom.ODPackage.updateTypeAndVersion(Unknown Source)
     at org.jopendocument.dom.ODPackage.putFile(Unknown Source)
     at org.jopendocument.dom.ODPackage$1.processEntry(Unknown Source)
     at org.jopendocument.util.ZippedFilesProcessor.process(Unknown Source)
     at org.jopendocument.dom.ODPackage.<init>(Unknown Source)
     at org.jopendocument.dom.ODPackage.<init>(Unknown Source)
     at org.jopendocument.dom.spreadsheet.SpreadSheet.createFromFile(Unknown
Source)

Hi,

This means that 2 files in your spreadsheet are not in agreement over the version. From what I see, it might be because some file lacks the required office:version attribute (e.g. content.xml has version 1.1 and styles.xml has no version). If you could send the ODS, I will look at it. Also what version of jOpendDocument are you using ?


I hope you can help me :)

Thank you in advance for your response and sorry for my english.

Pas de problème :)


Cheers,
Sylvain

--

--- You received this message because you are subscribed to the Google Groups "jOpenDocument" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jopendocument+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to