Unsupported HTML elements causing issue in excel export

Test.zip (637 Bytes)

Please refer to the above csv file. Please note that it was observed by some of users as for now.

@Bhumika.Shah,

I tested your scenario/case using the following sample code (“<” was replaced to “&lt;” and “>” to “&gt;”), it works fine.
e.g.
Sample code:

System.Data.DataTable table = new System.Data.DataTable();
table.Columns.Add("ID");
table.Columns.Add("Name");
table.Columns.Add("TestField");
string[] addrow = {"1", "Name1", " &lt;font color=\"rgba(0, 0, 0, 0)\"&gt;&lt;span style=\"background-color: var(–color-field-bg); color: var(–color-field-text); font-size: 0px;\"&gt;Test111&lt;/span&gt;<br>"};

table.Rows.Add(addrow);

var workbook = new Workbook();
var ws = workbook.Worksheets[0];
ws.Cells.ImportData(table, 0, 0, new ImportTableOptions
{
IsFieldNameShown = true,
IsHtmlString = true
}); 
workbook.Save("g:\\test2\\out1.csv");

Please find attached the output CSV file for your reference.
out1.zip (289 Bytes)
You will notice the CSV file by Aspose.Cells is rendered as expected.

I did not get your mentioned issue, something similar to:
i.e.,

Thats true. This was caused to some user and not all so far. It’s different than previously mentioned which were always reproducible.

@Bhumika.Shah,

You should check what sample code is being used/processed on the machines of those users. I guess there is something wrong/different either with code or data being used for those users.

Data was same. I am also curious and output in image that I had shown is reported by same user.

@Bhumika.Shah,

That is really strange. Since we could not reproduce the issue on our end, we cannot evaluate or figure out the issue. Anyways, we still think there is something different on the machines for those users.

Ok. Kindly please ensure once that no part of code can yield “class a b c d” kind of results.

@Bhumika.Shah,

Yes, we already ensured and such a result, i.e., “a b c d” is not yielded by Aspose.Cells APIs.

1 Like

Whenever the date is finalized for release, please update. So that the team can schedule it accordingly.

@Bhumika.Shah
We plan to release Aspose.Cells v24.4 this week. Once the version v24.4 is released, we will notify you promptly.

1 Like

@Bhumika.Shah,

Moreover, we have started the release process and if everything goes smoothly, we will publish the new version, i.e., Aspose.Cells for .NET v24.4, tomorrow.

1 Like

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

May I know how the rgba shall be processed in below cases. Although my input had font-color=rgba(0,0,0,0) which seems to have no effect and simply removed, when I use it with color it seems to provide white forecolor with any input. Though I have not seen this as input in client’s database, I understand. Just wanted to make it clear about how they are processed.

Please add < and > at both ends.

span style="color: rgba(0, 0, 0, 0); ">Test1</span
span style="color: rgba(255, 0, 0, 0); ">Test2</span
span style="font-color: rgba(255, 0, 0, 0); ">Test3</span
span style="font-color: rgba(0, 0, 0, 0); ">Test4</span

@Bhumika.Shah
Thank you for your feedback. We will evaluate your issue as soon as possible. Once we have any new information, we will share it with you. We will get back to you soon.

1 Like

@Bhumika.Shah ,

The rgba is processed with white as the forecolor, the calculation method is as following:

R = (int)(a * r + 255  * (1 - a));
G = (int)(a * g + 255  * (1 - a));
B = (int)(a * b + 255  * (1 - a));

We will consider using the “background-color” of the style as forcolor in the next version.

I understand equations but did not get what you have said. Can you please explain.

@Bhumika.Shah

Thank you for your feedback. Sorry for any confusion caused to you. By encapsulating the provided test data into an HTML file, manually opening the HTML file using Excel and comparing it with the output results of Aspose.Cells, we can see some text colors are white, which is different from the display results in Excel. Please refer to the attachment. ResultFile.zip (60.7 KB)

The sample code as follows:

Workbook wb = new Workbook(filePath + "a.html");
wb.Save(filePath + "out_net.xlsx");

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

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.

@Bhumika.Shah ,

If a(alpha) of font RGBA color is 0, the text color is transparent, so it is same as background color (White) in browser then according to the above formula (R= 0*r+255*(1-0)), the resulting rgb is (255,255,255).
The text color is same with background in the browser, so you can not see text either.
In order to make the text visible, we are considering ignoring font rgba color if a(alpha) is 0.

BTW, “font-color” is not a valid attribute of <style>, so no matter what its value is, the font color is always black.

1 Like

@Bhumika.Shah ,

We are pleased to inform you that your issue (filed as CELLSNET-55501) has been resolved. The fix will be included in an upcoming release (Aspose.Cells v24.5) that we plan to release in the first half of May 2024. You will be notified when the next version is released.

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