Skip to main content

ASPxSpreadsheet.SaveCopy(DocumentFormat) Method

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

Namespace: DevExpress.Web.ASPxSpreadsheet

Assembly: DevExpress.Web.ASPxSpreadsheet.v24.1.dll

NuGet Package: DevExpress.Web.Office

Declaration

public byte[] SaveCopy(
    DocumentFormat format
)

Parameters

Name Type Description
format DocumentFormat

The document format.

Returns

Type Description
Byte[]

An array of bytes where to save the document.

Remarks

Use the SaveCopy method to save a copy of the active document to a byte array 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;

byte[] documentContentAsByteArray = ASPxSpreadsheet1.SaveCopy(DocumentFormat.Xlsx);
// Your custom logic to save a document to a custom storage

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SaveCopy(DocumentFormat) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also