Set column format to boolean (TRUE FALSE) in ClosedXML

128 Views Asked by At

I am using ClosedXML to generate an Excel file which is partly filled in. One of the columns has boolean values. I would like to display these boolean values as TRUE / FALSE. I noticed that Column.Style.NumberFormat can be used to format numbers as scientific notation etc. However, there is no suitable value in XLPredefinedFormat for booleans. How to set data type / format of the entire column to show TRUE / FALSE instead of 1 / 0?

1

There are 1 best solutions below

0
Francois Botha On BEST ANSWER

There is no specific format for boolean types. Just ensure the underlying values are boolean (not 1s and 0s) and format the range as General.