Skip to content

Instantly share code, notes, and snippets.

@DDzia
Last active November 25, 2018 11:45
Show Gist options
  • Save DDzia/e29737170b6dd0f071c90b12f66c293d to your computer and use it in GitHub Desktop.
Save DDzia/e29737170b6dd0f071c90b12f66c293d to your computer and use it in GitHub Desktop.
foreach (Row currentRow in rows)
{
//write the row start element with the attributes added above
_writer.WriteStartElement(currentRow);
foreach (OpenXmlElement currentCell in currentRow.ChildElements)
{
var cell = (Cell)currentCell;
//write the start of the cell element with the type and cell reference attributes
_writer.WriteStartElement(cell);
//write the cell value
_writer.WriteElement(cell.CellValue);
//write the cell end element
_writer.WriteEndElement();
}
//write the row end element
_writer.WriteEndElement();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment