How to render HTML tag in excel

Hi,

I need to convert text like text into text . Please let me know how to accomplish this using aspose.

Thanks

Hi,

Thanks for your posting and considering Aspose.Cells for .NET.

Please download and use the latest version:
Aspose.Cells
for .NET v7.3.0.3


You need to use the Cell.HtmlString property to render HTML tag in output excel file.

Please see the following code. I have also attached the output xlsx file and the screenshot for your reference.

C#


Workbook workbook = new Workbook();


Worksheet worksheet = workbook.Worksheets[0];


Cell cell = worksheet.Cells[“A1”];


cell.HtmlString = “text”;


workbook.Save(“output.xlsx”);

Screenshot:

i am getting error:

Property or indexer 'Aspose.Cells.Cell.HtmlString' cannot be assigned to -- it is read only

Hi,

Are you using the same code and the latest version: Aspose.Cells
for .NET v7.3.0.3
and still getting this problem?

Probably, you are using .NET Framwork Client Profile. There is a separate dll for it.

Please download and try the latest Client Profile fix: Aspose.Cells for .NET v7.3.0.3 (Client Profile)

It should fix your issue.

Hi,

I am not able to render the following tag :

<p style="background-color:Red">Text</p>

Hi,

You are right. I have noticed that you cannot set the background fill color, but you can set the foreground font color using this html.

your text

We will look into this issue and resolve the error and get back to you asap.