I'm retrieving text from a DB which contains the SpreadsheetML representation of an XLS file; I want to take that text into a MemoryStream and load that into the GridDesktop control. The the user will make changes, and I want to save the spreadsheet XML back to the DB. So far, I get an "Object reference not set to an instance of an object." error when trying to open the file from a MemoryStream. Here is the code:
public void SetActiveWorkbook(string content)
MemoryStream ms = new MemoryStream();
ASCIIEncoding ascEncoding = new ASCIIEncoding();
byte xmlBytes = ascEncoding.GetBytes(content);
ms.Write(xmlBytes, 0, xmlBytes.Length);
gridDesktop.ImportExcelFile(ms); //error here
Another question, is there a way to create an Aspose.Cells.Workbook and then assign that instance to the GridDesktop?