Hello. I am exporting a column to an excel spreadsheet. This column is for currency and if it is null, I want it to export at N/A, otherwise I want the value formatted as style 5. I have the following in my code:
Column expenditureColumn = worksheet.Cells.Columns;
expenditureColumn.Style.Number = 5;
expenditureColumn.Style.HorizontalAlignment = TextAlignmentType.Right;
worksheet.Cells.ImportDataColumn(dataSource.Occurrence, false, 11, 7, 13, false); // Expenditures
This works fine to handle the case where there is a value, but I can't figure out how to tell it if it's null, write out N/A. I thought about using a custom style similar to those that have the text colored red for negative values, but couldn't seem to get that working.
Any help would be greatly appreciated.