Unsupported HTML elements causing issue in excel export

Aspose does not support some of below elements:

  1. background-color: var(–color-field-bg)
  2. color: var(–color-field-text)
  3. font color=“rgba(0, 0, 0, 0)”

which I have to manually replace every time in database using SQL query with below elements

  1. background-color: white
  2. color: black
  3. font color=“black”

Some of version handles some of elements but not all. It is possible that this HTML formatted text is copied from external sources to the text editor in the application. It does not cause issue in text editor but exporting excel fails while using Aspose.Cells. It is being faced by multiple clients. Kindly guide in this matter urgently.

1 Like

@Bhumika.Shah,

Please note that Aspose.Cells follows MS Excel standards and specifications when parsing or rendering HTMLs. You can verify this by manually importing and exporting HTML in MS Excel, and you will notice that MS Excel also has the same limitations.

If you still believe that Aspose.Cells does not adhere to MS Excel standards, please provide a demo use case (source code that can be run without compilation errors) for evaluation, and we will check it soon.

PS. Please zip the resource files before attaching them here.

1 Like

@Bhumika.Shah
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-55009

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.

1 Like

@Bhumika.Shah,

We are pleased to inform you that your issue (logged earlier as “CELLSNET-55009”) has been resolved. Aspose.Cells now supports parsing color attribute containing “var” or “rgba” fields. The fix/enhancement will be included in the upcoming release (Aspose.Cells v24.2) that we plan to release in the next week. You will be notified when the next version is released.

1 Like

Thank you Can you please also look at error for “Font size out of range” when font size is 0 or 1. ex. font-size:0px

<span contenteditable=“false” style=“border-top:1px dashed #ff0000; color:#ffffff; display:block; font-size:0px; height:0px; left:0px; line-height:0px; margin:0px; padding:0px; position:absolute; right:0px; top:116.391px; user-select:none; z-index:9999”

@Bhumika.Shah
Would you like to provide your sample file? We will check it soon.

style = “font-size:0px";

@Bhumika.Shah
Based on the detailed information you provided, we have created a sample file and tested it using the following code in version v24.1. We can obtain the correct results. No exceptions were thrown. Please refer to the attachment. result.zip (7.0 KB)

The sample code as follows:

Workbook workbook = new Workbook(filePath + "sample.html");

workbook.Save(filePath + "out_net.xlsx");

If you have any questions or confusion. Please provide your sample files and test code, we will check them soon.

span style=“font-size:1px;”>Test</span

With this I am able to see “Font size is out of range.” error. (Please add brackets on both the ends.)

asheet.Cells.ImportData(mappedData, 0, 0, options)

At this line it throws error. I will try for the test code. Thanks.

@Bhumika.Shah,

We appreciate if you could create and provide a standalone console demo application (complete source code without any compilation errors), zip the project with its resource files and post us to reproduce the issue on our end. We will check your issue soon.

Sure, working on it. Meanwhile can you please confirm if all the below 3 were resolved for the next week’s release.

  1. background-color: var(–color-field-bg)
  2. color: var(–color-field-text)
  3. font color=“rgba(0, 0, 0, 0)”

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

1 Like

@Bhumika.Shah,

Yes, please try Aspose.Cells for .NET 24.2 and let us know your feedback.

Sure, I also was curious that we had used one of the Aspose version, same in 2 different app versions. Yet we faced issue only in 1 whereas in another we dint face any issue at all despite having exactly same piece of code,

@Bhumika.Shah,

Maybe you are using two different Aspose versions in those applications. Please try Aspose.Cells for .NET 24.2. If you face any issue with Aspose.Cells for .NET 24.2, let us know with details and simulation code (with resource files), we will check it soon.

Sure, will let know. Thank you for your support.
The Aspose version had been same. Though none of the above issues were faced in the particular app version.
I may not be able to provide sample code for font size at the moment as having some priority tasks and may also handle the issue differently at the moment.

We had considered plain text in the particular version and thus not reproducible. Please ignore that.

@Bhumika.Shah,

Alright and good to know that you can cope with it by using plain text.

Alright, it’s good to know that you can handle it using plain text.
By the way, out of curiosity, we would love to address any issues in the APIs. So, once you find some time, kindly write sample code and provide it to us with all the details to reproduce the issue on our end. We will check and try to figure it out soon.

1 Like

As I tested new DLL var issue was resolved. But rgba and font size still remains.
Can you please test below examples once again.

<font color=“rgba(0, 0, 0, 0)”>
span style=“font-size:0px;”>Test</span

Thanks.

@Bhumika.Shah,

Could you please share your sample (runnable) code and sample files (please zip the file(s) prior attaching) to reproduce the issue on our end, we will check your issue soon.