0

I just started to learn NPOI. I think, that I have some idea how to use it, but I just need two more things to know how to do. The first one is how to get the minimum size (height and width) of the cell with some text and style, so I will be able to set the correct cell size. I can't use the auto size feature, because I have structured document and I need some different text in the same column to be on multiple lines.

An example:

Name column width

I need the column "Name" to have size of "Total amount". Is there a way, how to get the width of the"Total amount" text for selected font?

Thank you.

Jakub Čermoch
  • 431
  • 1
  • 9
  • 20
  • A hacky workaround would be to put "Total amount:" in a blank column, auto-fit and then read the width of the column. – SnowGroomer Nov 29 '20 at 13:58
  • @SnowGroomer I understand the idea, but I have no idea how to achieve that. I assume, that if I set AutoFit, I also have to somehow render the column, so it will get "real" width – Jakub Čermoch Nov 29 '20 at 14:10

0 Answers0