Wrong export to html

Hi

we are having an issue on our service (docker that runs on Azure cloud as a kubernetes pod with Debian 11 OS.).
When we try to convert the name range DR_PUBv2__1648448656 in the sorce.xlsx we are having an issue with the formatting of cells N10, H10, N14, H14, N19 & H19

You can see that number is hidden behind red/green circle.

The code we run is below.
The source and the output are attached Html-Render-Docker.zip (24.1 KB)

Any ideas?

Thanks!
Ori

private HtmlSaveOptions HtmlSaveOptions =>
new()
{
ExportImagesAsBase64 = true,
ExportPrintAreaOnly = true,
ExportHiddenWorksheet = false,
ExcludeUnusedStyles = true,
ExportActiveWorksheetOnly = true,
Encoding = Encoding.UTF8
};

worksheet.PageSetup.PrintArea = range.Address;
workbook.Worksheets.ActiveSheetIndex = worksheet.Index;

using var html = new MemoryStream();
workbook.Save(html, _htmlOptions););

@orik,

Thanks for the sample file.

We have logged a ticket with an id “CELLSNET-51608” for your mentioned issue. It works fine though if we execute your sample with your template file on Windows. The ticket is logged as following:
CELLSNET-51608 - Number is hidden behind red/green circle when exporting Excel to HTML on docker (Azure cloud kubernetes).

We will look into the details of the issue. Once we have an update on it, we will let you know.

@orik

The output html file you shared is modified by other program after it is generated by Aspose.Cells.
It seems that the html file you shared is broken, e.g. style x89 is missing which is used by class='x89' for Cell H10.

Please share us the html file directly generated by Aspose.Cells(without modified by other program) with the sample source file and code you shared:

@Peyton.Xu - thank you for your replay, due to logistic issues, we’ll be able to provide this info only next week.

Will update the ticket when we’ll have the data.

Thank for your support

@orik,

Please take your time to provide the resource file and other details. We will evaluate your issue once you provide the needful artifacts or file(s).

Hi,
Sorry for the delay here,

We were finally managed to reproduce it.
please see the attached example, we exported to html the range of DR_PUBv2__1648448656
The attached html is a direct result from Aspose (no modification by “other program”).
This was reproducing also on my local machine.
export-html-example.zip (19.4 KB)

Please advise,
Thanks
Ori

@orik,

Thanks for the input Excel file output HTML.

I have logged your resource files with your existing ticket “CELLSNET-51608” into our database and reopened your issue again. We will look into the details of your issue and get back to you once an update is available.

@orik

Similar issue that style x73 is missing which is used by class='x73' for Cell H10, the output html may be modified after generated by Aspose.Cells.

To make things easier, please share us a standalone project with source file and code to reproduce the issue.

I am following up on this issue since my colleague is on vacation.
Our code is not modifing the HTML - but it adds hyperlinks to all non empty cells with formulas. It is taking the existing style of the cells - adds the hyperlink and puts back the old style.
input.zip (12.1 KB)

Attached also the actual file.

var HtmlSaveOptions  = new HtmlSaveOptions
{
	ExportImagesAsBase64 = true,
	ExportPrintAreaOnly = true,
	ExportHiddenWorksheet = false,
	ExcludeUnusedStyles = true,
	ExportActiveWorksheetOnly = true,
	Encoding = Encoding.UTF8
};

var file = "c:\\temp\\input.xlsx";
using var workbook = new Workbook(file);

var worksheet = workbook.Worksheets["Sheet1"];
var name = workbook.Worksheets.Names["DR_PUBv2__1648448656"];
var range = name.GetRange();

var links = worksheet.Hyperlinks;

for (var rowOffset = 0; rowOffset < range.RowCount; rowOffset++)
{
	for (var colOffset = 0; colOffset < range.ColumnCount; colOffset++)
	{
		var cell = range[rowOffset, colOffset];

		if (!cell.IsFormula)
			continue;

		if (cell.Value == null || !cell.IsNumericValue)
			continue;

		var style = cell.GetStyle();
		var styleSet = $"javascript:void(0);_AAAAXX$33_{cell.Name}";
		links.Add(cell.Name, 1, 1, styleSet);
		cell.SetStyle(style);
	}
}

worksheet.PageSetup.PrintArea = name.GetRange().Address;
workbook.Worksheets.ActiveSheetIndex = worksheet.Index;

workbook.Save("c:\\temp\\my_file.html", HtmlSaveOptions);

@eyalmolad,

Thanks for the input file and code segment.

I have logged it with your existing ticket into our database and we will be looking into it soon.

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

@eyalmolad,

This is to notify you that the issue has been resolved. This fix will be included in the next (upcoming) release (Aspose.Cells for .NET 22.9) scheduled for the second week of September 2022. You will also be notified when the next version is released.

1 Like

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