I am having a similar issue. I have an Oracle datasource that I'm importing into a datatable (via ODP.NET).
I can create the spreadsheet, but I always get the "number stored as text" message. I have been using a workaround, but now I have a data set that's just too big.
Here is how I'm currently trying to solve the issue: (formatCols is a list of NameActionDictionary, which contains column name, position and format)
Thanks.
I can create the spreadsheet, but I always get the "number stored as text" message. I have been using a workaround, but now I have a data set that's just too big.
Here is how I'm currently trying to solve the issue: (formatCols is a list of NameActionDictionary, which contains column name, position and format)
foreach (NameActionDictionary numCol in formatCols)
{
ws.Cell(1, numCol.ColLoc).Value = 0;
ws.Column(numCol.ColLoc).DataType = (numCol.ColType == "date") ? XLCellValues.DateTime : XLCellValues.Number;
if (numCol.ColType != "date" && numCol.ColType != "number")
{
ws.Column(numCol.ColLoc).Style.NumberFormat.Format = getNumberFormatType(numCol.ColType);
}
ws.Cell(1, numCol.ColLoc).DataType = XLCellValues.Text;
ws.Cell(1, numCol.ColLoc).Value = numCol.ColHead;
}
Is there anyway I can solve this problem? I want dates and numbers to be stored as such.Thanks.