Spread WPF Documentation
SaveExcel(Stream,ExcelFileFormat,ExcelSaveFlags,String) Method
Example 


GrapeCity.Windows.SpreadSheet.UI Namespace > GcSpreadSheet Class > SaveExcel Method : SaveExcel(Stream,ExcelFileFormat,ExcelSaveFlags,String) Method
The stream to save to.
The file format.
Options for saving to a file.
The file password.
Saves GcSpreadSheet to an Excel Compound Document File.
Syntax
'Declaration
 
Public Overloads Sub SaveExcel( _
   ByVal stream As System.IO.Stream, _
   ByVal format As ExcelFileFormat, _
   ByVal saveFlags As ExcelSaveFlags, _
   ByVal password As System.String _
) 
'Usage
 
Dim instance As GcSpreadSheet
Dim stream As System.IO.Stream
Dim format As ExcelFileFormat
Dim saveFlags As ExcelSaveFlags
Dim password As System.String
 
instance.SaveExcel(stream, format, saveFlags, password)
public void SaveExcel( 
   System.IO.Stream stream,
   ExcelFileFormat format,
   ExcelSaveFlags saveFlags,
   System.string password
)

Parameters

stream
The stream to save to.
format
The file format.
saveFlags
Options for saving to a file.
password
The file password.
Example
This example uses the SaveExcel method.
string f;
f = "c:\\zipfile\\test1.xlsx";
// Open an existing file named test1.xlsx
System.IO.FileStream s = new System.IO.FileStream(f, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite);
gcSpreadSheet1.SaveExcel(s, GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX);
//gcSpreadSheet1.SaveExcel(s, GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, "12Test9");
//gcSpreadSheet1.SaveExcel(s, GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, GrapeCity.Windows.SpreadSheet.Data.ExcelSaveFlags.DataOnly);
//gcSpreadSheet1.SaveExcel(s, GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, GrapeCity.Windows.SpreadSheet.Data.ExcelSaveFlags.DataOnly, "12Test9");
s.Close();
gcSpreadSheet1.Invalidate();
Dim f As String
f = "c:\zipfile\test1.xlsx"
' Open an existing file named test1.xlsx
Dim s As New System.IO.FileStream(f, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite)
GcSpreadSheet1.SaveExcel(s, GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX)
'GcSpreadSheet1.SaveExcel(s, GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, "12Test9")
'GcSpreadSheet1.SaveExcel(s, GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, GrapeCity.Windows.SpreadSheet.Data.ExcelSaveFlags.DataOnly)
'GcSpreadSheet1.SaveExcel(s, GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, GrapeCity.Windows.SpreadSheet.Data.ExcelSaveFlags.DataOnly, "12Test9")
s.Close()
GcSpreadSheet1.Invalidate()
See Also

Reference

GcSpreadSheet Class
GcSpreadSheet Members
Overload List