打开xml,设置cellvalue html字符串

时间:2016-03-14 05:20:18

标签: c# openxml

技术:C#,openxml 我正在尝试使用opennxml文档创建xlsx文件。数据表包含一个在html字符串中包含富文本的列。示例“ hi ”或 hi 如何将值/值设置为cellValue.Text。请建议任何其他方法来实现这一目标。

          Cell cell = new Cell() { CellReference =                           ExcelHelper.ColumnCaption.Instance.Get((Convert.ToInt32((UInt32)rowIndex) - 2), cIndex), DataType = CellValues.InlineString };

          cell.DataType = new EnumValue<CellValues>(CellValues.String);

         CellValue cellValue = new CellValue();                        
         cellValue.Text = data.Rows[rIndex][cIndex].ToString();//<b>hi</b>
         cell.Append(cellValue);

0 个答案:

没有答案