Search code examples
c#npoicell-formatting

NPOI create cell containing bold and non bold text


I'm using NPOI to output excel from Asp.Net MVC app and works very well with plain text but have now been requested to add formatting and am having problems where I need to have a single cell with bold text followed by non-bold text. e.g.

This text bold - this text normal

I know I can give a cell a single style but this won't help and I cannot see anyway to give a cell some pre-formatted rich text.

The only possible solution that I can think of is creating two cells separately and the merge them together but will that then mean the formatting will be lost?

Is there a way to do this that I have missed in NPOI?


Solution

  • After a fair amount of investigation it seems that you are not able to do this inside of NPOI as it doesn't provide the necessary functionality to allow you to set formatting on specific text within a cell like I was attempting to do.