I'm getting a List of objects which I get from my database and save it to an Excelsheet using
var options = new ExcelImportDataOptions
{
PreserveTypes = true,
FirstColumn = 1,
FirstRow = 1,
IncludeHeader = true,
NestedDataLayoutOptions = ExcelNestedDataLayoutOptions.Merge
};
worksheet.ImportData(data, options);
This works fine.
In my dto I'm using [DisplayName("Foo bar")] to set the header in the Excelsheet.
This works fine as well.
Can I do something similar to make my 'long' variable format as 'Currency' in the Excelsheet?
I mean using attributes?
I tried formatting after importing but then I can't distinguish between a 'long' variable that needs to be formatted as 'Currency' and a 'ushort' variable that doesn't need to be formatted as a 'Currency'.
Please advise.