Doesn’t work:
titleCell.HtmlString = "Title "
Works fine:
titleCell.HtmlString = " Title"
Same, works fine:
titleCell.HtmlString = "Title Title2"
Aspose.Cells updated in october 2024
Doesn’t work:
titleCell.HtmlString = "Title "
Works fine:
titleCell.HtmlString = " Title"
Same, works fine:
titleCell.HtmlString = "Title Title2"
Aspose.Cells updated in october 2024
I tested your scenario/case using latest version/fix: Aspose.Cells 25.1.x (Releases | NuGet) and it works OK.
e.g.,
Sample code:
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
string value = "Test ";
worksheet.Cells[1,1].HtmlString = value;
value = " Test ";
worksheet.Cells[2,1].HtmlString = value;
value = " Test Test ";
worksheet.Cells[3,1].HtmlString = value;
value = " Test Test";
worksheet.Cells[4,1].HtmlString = value;
workbook.Save("e:\\test2\\out1.xlsx");
Please find attached the output Excel file for reference.
out1.zip (5.9 KB)
If you still find the issue with latest version/fix, let us know with details and sample files to reproduce the issue on our end and will look into your issue soon.
try this as title
var htmlTitle = "<div class='ui-title ui-property-title' style='text-align: left;'>SDgadshjf </div>"
titleCell.HtmlString = htmlTitle;
Thanks for the further details.
I am able to reproduce the issue as you mentioned by using your html string. I found that apparently I can’t set HTML title that ends with “space”, there is no space after the word.
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
string value = "<div class='ui-title ui-property-title' style='text-align: left;'>SDgadshjf </div>";
worksheet.Cells[1,1].HtmlString = value;
workbook.Save("e:\\test2\\out1.xlsx");
We require thorough evaluation of the issue. 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-57745
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.
We evaluated your issue in details.
If you write the same HTML string, i.e,"SDgadshjf " in an HTML file and then open it into the browser, you will see that there is no space after the word either. So, Aspose.Cells works the same way as the browser. You can use “
” to display space:
"<div class='ui-title ui-property-title' style='text-align: left;'>SDgadshjf </div>";
Let us know if you still have any issue or confusion.
Ur example with “opening it in browser” gives me no sense how it should save me from .net error while building a document. I’m just asking you to handle it on your side. Setting a property and getting nullRef is wild and by my experience should be fixed on your side, not each customers side.
I simply want to convey that the problem does not lie with the Aspose.Cells APIs, but rather with how the browser handles the ending space by eliminating it. To verify this, I created a sample HTML file using your HTML string, saved it, and opened it in the browser (please see the attached sample HTML for your reference).
test1.zip (244 Bytes)
I noticed that the trailing space isn’t recognized (you can attempt to highlight the text and see that there is no trailing space) while examining/viewing it. We believe this is not a problem with Aspose.Cells and cannot be resolved within the API.