Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
492
Set html content in excel cell
posted

Hi,

  For my requirement, i have to export multiple dataset to excel and create multiple sheets. Based on my data i have to create dropdown and populate the cell. For this requirement instead of direct export using excelexport dll, i have created worksheet and updated the value.

My dataset contains several html data (eg:<b><u>Test1<u> Test2</b>). If i place the data inside excell cell, it displaying with node like <b><u>Test1<u> Test2</b>, but i want to display it as formatted text as html(eg: Test1 Test2).

To reproduce this,  i will paste here sample code

 Infragistics.Excel.Workbook wBook = new Workbook(WorkbookFormat.Excel2007,WorkbookPaletteMode.StandardPalette);

Infragistics.Excel.

Worksheet wSheet = wBook.Worksheets.Add("Export");

wSheet.Rows[2].Cells[2].Value =

"<b><u>Test1</u> Test2</b>";

 

 

 

wBook.Save(@"E:\\Test.xlsx");

It is the urgent requirement for me, any solution for this issue.

Regards,

 Micky

 

 

 

Parents
No Data
Reply
  • 69832
    Offline posted

    Assign a FormattedString to the Value property. The FormattedString class exposes a GetFont method which has integer parameters which represent the character positions to which those font attributes are to be applied.

Children
No Data