Office Open XMl SDK escribiendo números en hoja
Estoy intentando escribir números de una tabla de datos en una hoja de datos; desafortunadamente, esto no funciona como se esperaba, e. sol. La hoja de datos está dañada.
Estoy usando el siguiente código:
private void AddDataToSheet(ExcelViewData data, SheetData sheetData)
{
var excelData = data.WriteableDataTable;
//// this returns a datatable
////the numbers have a format like "8,1" "8,0" etc.
for (int i = 0; i < excelData.Rows.Count; i++)
{
Row row = new Row();
//row.RowIndex = (UInt32)i;
for (int c = 0; c < excelData.Columns.Count; c++)
{
Cell cell = new Cell();
CellValue cellvalue = new CellValue();
//cell.CellReference = SharedMethods.GetExcelColumnName(i + 1) + (c + 1).ToString();
cell.DataType = DocumentFormat.OpenXml.Spreadsheet.CellValues.Number;
cellvalue.Text = excelData.Rows[i][c].ToString().Replace(",",".");
cell.Append(cellvalue);
row.Append(cell);
}
sheetData.Append(row);
}
}
¿Alguna idea de por qué esto falla? Me han parecido múltiples tutoriales con el mismo enfoque.