I am using asheet.Cells.ImportData(Datatable). There is no other significant code used here. Please note that it was found during export of some users.
Also, I just wanted to confirm that setting .IsHTMLString to True or False does not make any difference in csv export.
I tested using the following sample code. I created a dynamic DataTable in code. I added a column having your mentioned HTML tags in it. When I try to import data using Cells.ImportData, I still get the same exception(“System.FormatException : Input string was not in a correct format”) as we did get using Cell.HtmlString attribute.
e.g. Sample code:
In short, either you are not giving us actual (input) HTML string or you are using some other code segment or HTML string for your case. Since you are not ready to give us sample code to reproduce the issue on our end, so how could we evaluate your issue or figure it out? Please give us exact sample code (if possible). By the way, we are using Aspose.Cells for .NET v24.3. Are you using same version of some older version, which version? Please try using latest version.
Yes, it won’t make any difference. The reason is since CSV is text file format, so all the formatting would be lost when rendering to CSV.
We are pleased to inform you that your issues CELLSNET-55416, CELLSNET-55417 and CELLSNET-55436 have been resolved. The fix will be included in an upcoming release (Aspose.Cells v24.4) that we plan to release in the first half of April 2024. You will be notified when the next version is released.
Please note that below output was found for some users only during export to csv as I noticed.
Output
<span class=““ui-provider a b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak”” dir=““ltr””><font color=““rgba(0, 0, 0, 0)””><span style=““background-color: var(–color-field-bg); color: var(–color-field-text); font-size: 0px;””>Test
I tested your scenario/case using the following sample code (“<” was replaced to “<” and “>” to “>”), 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", " <font color=\"rgba(0, 0, 0, 0)\"><span style=\"background-color: var(–color-field-bg); color: var(–color-field-text); font-size: 0px;\">Test111</span><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.,
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.
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.
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.
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.