Click or drag to resize
ExcelFileSave Method (Stream, SaveOptions)
Saves the spreadsheet to the specified stream.

Namespace:  GemBox.Spreadsheet
Assembly:  GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 41.3.30.1018
Syntax
public void Save(
	Stream stream,
	SaveOptions options
)

Parameters

stream
Type: System.IOStream
The stream to which to save the spreadsheet.
options
Type: GemBox.SpreadsheetSaveOptions
The saving options which can be used to define settings for save operation.
Examples

Following code demonstrates different ways of saving ExcelFile to specified file format.

// Saves the spreadsheet to a file with the specified path
ef.Save("Report.xlsx");

using (FileStream stream = new FileStream("Report.pdf", FileMode.Create))
{
    // Saves file to the stream
    ef.Save(stream, SaveOptions.PdfDefault);
}

// Saves the file using specified save options
ef.Save("Report.html", new HtmlSaveOptions
{
    SelectionType = SelectionType.EntireFile
});
See Also