We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Serialize/Deserialize Spreadsheet Control

Hi,

I'd like to know if it is possible to serialize/deserialize the spreadsheet control as string, xml, binary, etc. Including;

Formatting
Named Ranges
Formulas
etc,

I'd appreciate your help.

Thanks in advance.

Carlos Diaz.

5 Replies

PS Pannir Selvam S Syncfusion Team August 20, 2013 05:47 AM UTC

Hi Carlos,

Thanks for contacting Syncfusion support.

We have analyzed your query and you can serialize and deserialize the spreadsheetcontrol as xml file by using the workbook like in the below code snippet and it should include formatting, formulas, named ranges etc.

Code Snippet[C#]:

private void Serialize_Click(object sender, RoutedEventArgs e)

{

    IWorkbook workbook = this.spreadsheetControl1.ExcelProperties.WorkBook;

    workbook.SaveAsXml('test.xml'ExcelXmlSaveType.MSExcel);

}

private void DeSerialize_Click(object sender, RoutedEventArgs e)

{

    ExcelEngine engine = new ExcelEngine();

    IWorkbook workbook = engine.Excel.Workbooks.OpenFromXml('test.xml'ExcelXmlOpenType.MSExcel);

    this.spreadsheetControl1.ImportFromExcel(workbook);

}

We have prepared a sample based on this and you can download the sample from the below location.

Sample: SpreadsheetDemo_WPF.zip

Regards,

Pannir



CD Carlos Diaz August 20, 2013 08:10 PM UTC

Hi Pannir,

I have a problem with the solution that you mentioned, and surely you will able to reproduce the problem: ( use the same project that you attached before )

1. Click on Serialize.
2. Click on Deserialize.
3. Click on Serialize again, HERE is raising an exception ( ArgumentOutOfRangeException ).

Could you help me to resolve that?

Thanks in advance.

Carlos Diaz.


PS Pannir Selvam S Syncfusion Team August 26, 2013 07:19 AM UTC

Hi Carlos,

 

Sorry for the inconvenience caused.

 

The reported query in this forum has been updated in the incident #111919 and you can follow the incident #111919 for further updates.

 

Please let us know if you have any queries.

 

Thanks,

Pannir



AR Andreas Rothmann October 9, 2013 06:30 AM UTC

Hi,

i am currently evaluating the spreadsheet control. Now the functionality is essential for my application. I am not sure i am able to follow incident from other users, so my question: Is the serialization and deserialization fixed in the latest update?

Thank you very much!
Andy


PS Pannir Selvam S Syncfusion Team October 16, 2013 01:35 PM UTC

Hi Andreas,

 

Yes. Now Serialization and Deserialization works properly in the SpreadsheetControl by using the code snippet provided in the previous update.

 

Please let us know if you need any further assistance.

 

Regards,

Pannir


Loader.
Live Chat Icon For mobile
Up arrow icon