Export xl file to html is corrupted

Hi There,

I am using latest version of Aspose.Cells (2024.2.0).
I have an excel file I got from a client (‘input-for-html-slim.xlsx’ attached) which I am trying to export to an html.
This is the code I am using:

 public static void ExportHtml(string inputPath, string htmlOutputPath)
 {
     Workbook wbc = null;
     using (FileStream ms = new FileStream(inputPath, FileMode.Open))
     {
         wbc = new Workbook(ms, new LoadOptions(LoadFormat.Xlsx));
     }

     var worksheet = wbc.Worksheets[0];
     var range = wbc.GetRangeByNamedRange("my_range");
     worksheet.PageSetup.PrintArea = range.Address;
     wbc.Worksheets.ActiveSheetIndex = worksheet.Index;
     //worksheet.AutoFitColumns();
     using var html = new MemoryStream();
     wbc.Save(html, _htmlSaveOptions);
     File.WriteAllBytes(htmlOutputPath, html.ToArray());
 }

The output.html file (attached) is corrupted and has a gibberish prefix.

export-to-html-corrupt.zip (631.7 KB)

Pleas advise,

Thanks,
Shlomi

@shlomi.z,

Thanks for the template XLSX file and details.

I was able to reproduce the issue as you mentioned by using your template XLSX file. I found the output HTML file has some gibberish prefix as you pointed out.

We require thorough evaluation of your issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-55160

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hey @amjad.sahi,

Thanks for the quick response! Please pay attention that when opening the output.html file using notepad++ there are redundant xml markups. When I removed it manually, the html file worked perfectly.

@shlomi.z,

Thanks for sharing your findings.

Yes, we noticed it, there is huge list of markups. We will be looking into your issue soon. Once we have an update on it, we will let you know here.

@shlomi.z ,

We are pleased to inform you that your issue has been resolved. The fix will be included in an upcoming release (Aspose.Cells v24.3) that we plan to release in the first half of March 2024. You will be notified when the next version is released.
Attached is the result after fix for your reference: output.zip (310.3 KB)

The issues you have found earlier (filed as CELLSNET-55160) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi