How to serialize or deserialize in WinForms Spreadsheet (SfSpreadsheet)?
Serialization and deserialization in spreadsheet
Spreadsheet provides support to serialize and deserialize the workbook using XlsIO.
For serialization, you can use SaveAsXml() method of IWorkbook.
// Serialize MemoryStream serializedBinary = new MemoryStream(); this.Spreadsheet.Workbook.SaveAsXml(serializedBinary, ExcelXmlSaveType.MSExcel);
For Deserialization, you can use OpenFromXml() method of IWorkbook .
// Deserialize serializedBinary.Seek(0, SeekOrigin.Begin); ExcelEngine engine = new ExcelEngine(); IWorkbook workbook = engine.Excel.Workbooks.OpenFromXml(serializedBinary, ExcelXmlOpenType.MSExcel); this.Spreadsheet.Open(workbook);