We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Cells html output is nondeterministic

Hi!

We are using code similar to the following to convert .ods files to html:

var input = @"...";
var targetFolder = @"...";

AsposeLicenser.LoadLicense();

Directory.CreateDirectory(targetFolder);

var targetPath = Path.Combine(targetFolder, "preview.html");
var options = new HtmlSaveOptions
{
    ExportImagesAsBase64 = true,
    ExportSingleTab = true,
    IsExportComments = false,
    ExportHiddenWorksheet = false,
    HiddenRowDisplayType = HtmlHiddenRowDisplayType.Remove,
    HiddenColDisplayType = HtmlHiddenColDisplayType.Remove,
    ExportGridLines = true,
    CreateDirectory = true
};

using (var wb = new Workbook(input))
    wb.Save(targetPath, options);

On consecutive runs on net6.0 this generates different outputs. E.g. when using the file from the archive attached and comparing the sheet001.htm file generated by two consecutive runs the diff looks like the following:
diff-snip.PNG (59.4 KB)

sample.zip (6.4 KB)

Even though visually the rendered html documents look the same, these differences in the output prevent us from doing integration tests where we expect certain output content.

Tested with Aspose.Cells 22.9.0 and 22.11.0. Note that when run from net47, the output is stable. We only observed this on net6.0. Also note that if you run this code twice on the same process (e.g. by putting it in a loop) the output will be the same, as far as I can tell only running it again in a separate process will result in different outputs.

We don’t see any reason for the output to be nondeterministic and would appreciate this to be fixed for testability.

Thanks,
Arnold

@arnoldbeilandevozon,

Thanks for the ODS file and screenshot.

Do you mean, to reproduce the issue, we should run your code in a .NET6.0 application to generate/render an HTML file form your ODS and then stop the application/process. Copy the output HTML at different location for version1. Now run the application again to render the HTML file as version2. Now compare sheet001.htm source for both outputs to trace the issue? Please elaborate/confirm if our understanding is correct?

Yes, that should reproduce the issue.

@arnoldbeilandevozon,

Thanks for the confirmation.

Please notice, I am able to reproduce the issue as you mentioned (via screenshot) in .NET6.0 (Target Os: Windows) project using your ODS document. I run your code in the .NET6.0 application to generate/render an HTML file form your ODS and then stop the application/process. Copy the output HTML at different location for version1. Now run the application again to render the HTML file as version2. Then, I compared sheet001.htm file source for both outputs and found the issue. I have logged a ticket with an id “CELLSNET-52338” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

@arnoldbeilandevozon,

This is to inform you that your issue has been resolved now. The fix will be included in our upcoming release (Aspose.Cells v22.12) which is scheduled in the first half of December, 2022. You will also be notified when the next version is released.