Hello,
In my project I’m exporting some columns containing TimeOnly values. I format the cells using the Style class. For example:
var cellsFactory = new CellsFactory();
var style = cellsFactory.CreateStyle();
style.SetCustom("h:mm", false);
style.SetPatternColor(BackgroundType.Solid, Color.Yellow, Color.Yellow);
style.Font.IsBold = true;
for (int row = 0; row < 5; row++)
{
for (int col = 0; col < 5; col++)
{
var cell = worksheet.Cells[row, col];
cell.PutValue(new TimeOnly(13, 37));
cell.SetStyle(style);
}
}
However once opened in Excel the values appear as regular strings.
image.png (3.4 KB)
Is the TimeOnly datatype not supported?
Best regards,
Erik
Working example: timeonly.zip (801 Bytes)