-
Notifications
You must be signed in to change notification settings - Fork 4
SharedStringTable #1
Copy link
Copy link
Open
Description
Hola!!
Mi consulta es necesito extraer de un Excel 3 columnas de las cuales 2 son string, la columna number la extraje perfectamente pero la string no pude porque me pide una funcion 3 argumentos y uno de ellos es el SharedStringTable, adjunto la funcion
public static string GetString(Row row, string columnReference, SharedStringTable stringTable)
{
var cell = GetCell(row.Elements(), columnReference);
if (cell != null && cell.DataType != null)
{
if (cell.DataType.Value == CellValues.SharedString)
{
return stringTable.ElementAt(int.Parse(cell.InnerText)).InnerText;
}
else if (cell.DataType.Value == CellValues.String)
{
return cell.InnerText;
}
}
throw new Exception($"Error en la columna {cell.CellReference.Value}. Se espera un valor Alfanúmerico");
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels