miachm / SODS

A simple Java library for handle ODS (Open Document Spreadsheet, compatible with Excel and Libreoffice)
The Unlicense
74 stars 30 forks source link

Issues when opened in Microsoft Excel #85

Closed MinMatth-Magi closed 10 months ago

MinMatth-Magi commented 11 months ago

This issue is related to this discussion.

Many incoherences remain when the .ods files generated with SODS are opened in Microsoft Excel.

I'll focus my example on 3 columns of the following generated file: sodsExample.ods

Here, the file is opened in LibreOffice: image

And here how it looks in Excel (without any edit, it is the exact same file): image

We can notice that some cells don't keep their original value once opened in Excel, and they can even be duplicated. I have no idea why to be honest :/ Hopefully, you might !

Please tell me if you need anything more, Matthieu

github-actions[bot] commented 11 months ago

Thanks for your report! Please ensure you have provided enough info in order to recreate the issue, including the problematic ODS File.

miachm commented 11 months ago

Could you edit the file in Excel (so it's shown as expected). Save it and send the file back to me?

Need to see what Excel is expecting.

MinMatth-Magi commented 11 months ago

Okay! Here are some files generated in different situations:

All those files have been manipulated/saved in Microsoft Excel directly. But sadly it seems that I cannot save a .ods file, opened in Microsoft Excel, as a .xlsx file.

miachm commented 11 months ago

Dam, I can't see a thing. I don't understand why Excel doesn't like it.

MinMatth-Magi commented 11 months ago

Excel is mean ! 😞

Do you think you will still be able to look into it or will it be a dead end ?

For sure, there are some differences between the generated file and the manually fixed ods file that I saved from Excel. 🤔

miachm commented 11 months ago

Of course there is a solution. But it's not that trivial like expected.

What I usually do is to rename the .ods to .zip. Then I extract the file and I check the XML tags for content.xml.

SODS XML tags are correct according the standard, that's why you can open it in Libre Office. But Excel doesn't follow the standard, it is expecting additional tags which are not documented.

The question is. Which tag?

miachm commented 10 months ago

This was tricky, but I managed to test it in the Excel Online. It should have the same behaviour for the desktop Excel (well, I hope :))

miachm commented 10 months ago

Sorry for the delay @MinMatth-Magi . It should be fixed now in 1.6.7

MinMatth-Magi commented 10 months ago

That did the trick ! Thank you ! 😄 I'm closing the issue now.

Little detail I noticed: the '\n' doesn't seem to work in Microsoft Excel while it does in LibreOffice. But it's not much of an annoyance for me personally 😉