Hello,
when exporting a worksheet to a DataTable, all values in the resulting Table are of type string. Is there a generic way to tell Spire to export date and numeric values as DateTime and Decimal, respectively?
KR,
Gerhard
DataTable dataTable = new DataTable();
dataTable.Columns.AddRange(worksheet.Range.Columns.Select(s => new DataColumn("Column" + s.Column, typeof(object))).ToArray());
foreach (CellRange row in worksheet.Range.Rows)
{
dataTable.Rows.Add(row.Cells.Select(s => s.Value2).ToArray());
}
worksheet.ExportDataTable(range: worksheet.Range, exportColumnNames: false);
CellRange[] rows = worksheet.Rows;
foreach (CellRange row in rows)
{
dataTable.Rows.Add(row.Cells.Select(s => s.Value2).ToArray());
}
Bandonia wrote:Hi Annika,
Is this feature available yet? I currently have numbers in an xml file that are being read in & converted to a datetime. I have outlined my issues with this in another ticket I have created.