Skip to main content

ASPxSpreadsheet.SaveCopy(Stream, DocumentFormat) Method

Saves a copy of the active document in the specified format to a stream.

Namespace: DevExpress.Web.ASPxSpreadsheet

Assembly: DevExpress.Web.ASPxSpreadsheet.v23.2.dll

NuGet Package: DevExpress.Web.Office

Declaration

public void SaveCopy(
    Stream stream,
    DocumentFormat format
)

Parameters

Name Type Description
stream Stream

A stream object where to save the document.

format DocumentFormat

The document format.

Remarks

Use the SaveCopy method to save a copy of the active document to a stream in the specified format. This method exports the document with the current changes, but do not affect the original document state (it does not initiate document synchronization, does not apply client changes to the document model, etc.).

using DevExpress.Web.Office;

using (MemoryStream documentContentAsStream = new MemoryStream()) {
  ASPxSpreadsheet1.SaveCopy(documentContentAsStream, DocumentFormat.Xlsx);
  // Your custom logic to save a document to a custom storage
}  
See Also