Skip to main content

Spreadsheet Document Management

  • 2 minutes to read

The ASPxSpreadsheet control always contains a document. If it was not opened or created explicitly in code, the control generates a new document.

When you open a document, the control loads it to a document storage in the web server’s memory (RAM). The storage is organized as a static dictionary inaccessible for developers. When another document is opened, the Spreadsheet does not close the previous document. The server memory still contains this document. You can use the DocumentManager API to obtain or close the document.

A document in the storage is identified by a unique string – DocumentId. The source of a document determines how it obtains an identifier:

  • If a document is opened from a file system, DocumentId is generated automatically based on a physical path to this document.
  • If a document is opened from a byte array or stream, the corresponding document load methods accept a DocumentId value as a parameter.
  • For a new document, you should explicitly specify the DocumentId value.

All operations that you perform in ASPxSpreadsheet affect the active (last opened) document whose DocumentId value is contained in the DocumentId property.

If you open a document from a database, you can use data record key values as document identifiers. The ASPxSpreadsheet control does not send DocumentId values to the client and uses random GUIDs instead.