Error opening ODS file

@mservdev,

Thanks for the screenshot and sample file.

That is strange as I do not get this issue with your new file and sample code (in the screenshot I shared in my previous post). What is your locale/regional settings set on the machine, could you provide details for your OS/environment where you are executing the task. My environment is: OS: Windows 8, regional/local settings: English (Singapore ), etc.

@Amjad_Sahi

OS: Windows 10
Region/local: German (Germany)

Or do you need more specific information?

@mservdev,

I did change the regional settings or my pc and try the sample code, it works fine and still I do not get this issue, see the screenshot for your reference:

Please make sure that you are using latest version/fix: Aspose.Cells for .NET v18.2.6 (link is already shared in one of our previous posts), you may even print the version number at the start before using the original code if you are using the correct version.
e.g
Sample code:

Console.WriteLine(CellsHelper.GetVersion());

@Amjad_Sahi

I think I found the problem :slight_smile:

I use the 18.2.6 version. The problem is, I have a NUnit test for my specific test and the result from Cells is “12.05.2028 20:13:07” also with your LoadOptions data. But if I create a normal Console application, the date is “12.05.2028 20:15:00”.

I suspect that the NUnit test will somehow affect the Cells result.

I’ll give you an example in a few minutes.

I have now set up an example project for you. The problem is, I can debug the NUnit test directly through Visual Studio / ReSharper. If you can’t do that, here’s an article on how to do it without it.

NUnitDate.zip (14.9 KB)

@mservdev,

Thanks for the sample project.

I did try simple Unit Test in VS.NET using the following sample code and it passes the test with your ODS file:
e.g
Sample code:

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Aspose.Cells;

namespace UnitTestProject1
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            Workbook workbook = new Workbook("E:\\test2\\error opening ods\\WrongDateTime.ods");
            workbook.CalculateFormula();

            var cell = workbook.Worksheets[0].Cells["C3"];

            Assert.AreEqual("8:15:00 PM", cell.DisplayStringValue);
        }
    }
}

However, I did not try NUnit test it yet as we got to first install Visual Studio Express Edition. We will try to do that soon.

Please don’t get me wrong. You don’t need to install VS Express. The article should only be a guide on how to debug an NUnit test. We work with Visual Studio Professional 2015 and use ReSharper, which allows us to easily perform NUnit tests directly from Visual Studio.

If you don’t have that, this link is the only way to do it with Visual Studio and the NUnit NuGet package.

Commenting on your MS Unit test, it is good to know that the error does not come with MSTest.

Edit
We are working with NUnit 2.6.4

@mservdev

Thanks for using Aspose APIs.

For your issue, we found the possible reason is that different frameworks keep different precision for float values. We will provide a fix for it soon.

This issue has been logged as

  • CELLSNET-45976 - Error opening ODS file possibly different frameworks keep different precision for float values
1 Like

@mservdev

Thanks for using Aspose APIs.

This is to inform you that we have fixed your issue CELLSNET-45976 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

@mservdev,

Please try our latest version/fix: Aspose.Cells for .NET v18.2.8 (.NET 4.0)

Your issue “CELLSNET-45976” should be fixed in it.

Let us know your feedback.

@Amjad_Sahi

Thanks it works! But I found two minor bugs. Please have another look at my attachment from above (NUnitDate.zip).

Bug at C32 - Whitespace is removed

Behaviour opened with Excel 2016 (Expected results)
Value: “bitte klicke hier”
Type: Hyperlink
Url: http://www.bing.de

Behaviour opened with LibreOffice Calc
Value: “hier”
Type: Hyperlink
Url: http://www.bing.de

Cells Behaviour
Value: “bitte klickehier”
Type: Hyperlink
Url: http://www.bing.de

Bug at A30 - NewLines are removed

Behaviour opened with Excel 2016 (Expected result)
Value: “⊃∆µ\n\n £✓✗\n\n →↔↑”

Behaviour opened with LibreOffice Calc (Expected result)
Value: “⊃∆µ\n\n £✓✗\n\n →↔↑”

Cells Behaviour
Value: “⊃∆µ\n£✓✗\n→↔↑”

Thank you!

@mservdev,

Thanks for the issues details.

I could not find your attachment to evaluate your issues, probably you forgot to attach it. Moreover, if would be much better if you could start new threads for newer issues (one thread per issue). This will be easier to manage your issues and consequently figure these out soon.

I meant the attachement above from here. But you’re right, I have created a new topic for this issues.

@mservdev,

Thanks for creating a new thread.

Please follow up your other thread for reference.

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

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

The issues you have found earlier (filed as CELLSNET-45976) have been fixed in this update. Please also check the following article:* <a href="Install Aspose Cells through NuGet|Documentation

The issues you have found earlier (filed as CELLSNET-45950) have been fixed in this update. Please also check the following article:* <a href="Install Aspose Cells through NuGet|Documentation

The issues you have found earlier (filed as CELLSJAVA-42545) have been fixed in this Aspose.Cells for Java 18.3 update. Please also check the <a href="Installation|Documentation

The issues you have found earlier (filed as CELLSJAVA-42545) have been fixed in this Aspose.Cells for Java 18.3 update. Please also check the document for your reference: Installation|Documentation