Back to Devexpress

SpreadsheetControl.SaveDocument(Stream, DocumentFormat) Method

wpf-devexpress-dot-xpf-dot-spreadsheet-dot-spreadsheetcontrol-dot-savedocument-x28-system-dot-io-dot-stream-devexpress-dot-spreadsheet-dot-documentformat-x29.md

latest2.0 KB
Original Source

SpreadsheetControl.SaveDocument(Stream, DocumentFormat) Method

Saves the workbook to a stream, specifying the export format.

Namespace : DevExpress.Xpf.Spreadsheet

Assembly : DevExpress.Xpf.Spreadsheet.v25.2.dll

NuGet Package : DevExpress.Wpf.Spreadsheet

Declaration

csharp
public void SaveDocument(
    Stream stream,
    DocumentFormat format
)
vb
Public Sub SaveDocument(
    stream As Stream,
    format As DocumentFormat
)

Parameters

NameTypeDescription
streamStream

The Stream object to output the document to.

| | format | DocumentFormat |

One of the DocumentFormat values that is the format of the exported document.

|

Remarks

Take into account the following when saving a document to a stream:

  • Do not save a workbook to a stream that does not support seek operations. An exception is thrown in this case. Use the System.IO.Stream.CanSeek property to determine if the steam supports seeking.
  • Do not save a workbook to the same stream from which it was loaded. In this case, document bytes are written to the end of the existing stream and an invalid document is produced.

See Also

SpreadsheetControl Class

SpreadsheetControl Members

DevExpress.Xpf.Spreadsheet Namespace