Export excel to html - Cells with custom number formatting

Hi there,

I have an excel file (attached ‘format-html-issue-input.xlsx’) which contains a custom number format in one of its cells (B3).
Using the following code with Aspose.Cells v23.11.0 I export it as html

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

        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 = worksheet.Cells.CreateRange(0, 0, 3, 2);
            worksheet.PageSetup.PrintArea = range.Address;
            wbc.Worksheets.ActiveSheetIndex = worksheet.Index;
            using var html = new MemoryStream();
            wbc.Save(html, _htmlSaveOptions);
            File.WriteAllBytes(htmlOutputPath, html.ToArray());
        }

In the output html (attached ‘format-html-issue-output.html’), in the cell (B3) value is ‘################’ instead of the original value from input file.

Attached is a zip file containing input xlsx file and output html file.

format-html-issue.zip (8.8 KB)

Please advise,

Thanks,

Shlomi

@shlomi.z,

Please add a line to your code segment before rendering to HTML file format.

worksheet.AutoFitColumns();

I have tested and it works Ok.

@amjad.sahi ,

Thank you for your quick response!
I tried adding the line of code:

worksheet.AutoFitColumns();

It works, but issue still persists for higher numbers with 7 figures.
I attached a zip file containing of input xlsx file and output html file.

format-html-issue-input-million.zip (8.8 KB)

Thanks,

Shlomi

@shlomi.z
By using sample file and code for testing, we can reproduce the issue. Discovering that cell values are displayed as # signs when converting files to HTML.

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-54629

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.

Hi @John.He @amjad.sahi
I guess version of December will include this fix? if we pay for the support, are you able to provide a faster fix? when it might be? thanks!

@Yogev_Brown,

We will try to fix the issue in the next upcoming December release, but there is no 100% certainty for it.

If you purchase paid support and escalate the issue/ticket, we will prioritize resolving the issue. Additionally, if you have availed priority support, you will receive the fixed version as soon as it becomes available.

@amjad.sahi what is the difference between “paid support” and “availed priority support”?

@Yogev_Brown,

Sorry for the confusion. When I mentioned “availed priority support,” I meant that if you have purchased paid support. Should you have further queries or comments, please feel free to write us back.

About this: does it mean I won’t have to wait to get official version (usually the end of each month)? so, we’ll get it immediately when the fix is ready?

@Yogev_Brown

According to Aspose company regulations, because your ticket is not a priority support, the issue will be released along with the release version after fixing the issue. Only after purchasing priority support, you can receive fixed version as soon as it becomes available.

@John.He
I’d like to register to the * Developer Small Business license: $599.00
Can you please instruct me how to?

@Yogev_Brown,

Regarding licensing/subscription, please post your queries in Aspose.Purchase section.

@amjad.sahi @John.He
I can’t get Apose.Purchase support to help me. Can you please inform whether this bug fix is included in the upcoming version?

@Yogev_Brown

Your issue is under the process of investigation. If it is not too complicated and we can solve it in time, then the fix for it will be included into the upcoming version. If the issue is complicated and we cannot solve it before the upcoming version being published, then the fix may be included into later versions when it is solved. We will provide more details about the ETA for this issue here when we finish the evaluation.

@Yogev_Brown,

This is to inform you that your issue has been resolved. The fix will be included in an upcoming release (Aspose.Cells v23.12) that we plan to release in the first half of December 2023. You will be notified when the next version is released.

Here is the result after fix for your reference: output.zip (1.8 KB)

@Eric.wang when is the new version (v23.12) expected to be deployed.
A few of our customers are waiting for some fixes.

Thanks, Shlomi

@shlomi.z
Aspose.Cells for .NET v23.12 will be released in the first half of December 2023. We will notify you when the next version is released.

@shlomi.z,

The new version (Aspose.Cells v23.12) is expected to be released next week. The exact date is not final as releases are published when ready.

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