Spread Silverlight Documentation
SaveExcel(Stream,ExcelFileFormat,String) Method
Example 


The stream to save to.
The file format to save to.
The password for the file.
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 password As System.String _
) 
'Usage
 
Dim instance As GcSpreadSheet
Dim stream As System.IO.Stream
Dim format As ExcelFileFormat
Dim password As System.String
 
instance.SaveExcel(stream, format, password)
public void SaveExcel( 
   System.IO.Stream stream,
   ExcelFileFormat format,
   System.string password
)

Parameters

stream
The stream to save to.
format
The file format to save to.
password
The password for the file.
Example
This example uses the SaveExcel method.
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.Filter = "Excel File (.xlsx)|*.xlsx";
bool? useClick = saveFileDialog.ShowDialog();
if (useClick == true)
{
    var stream = saveFileDialog.OpenFile();
    gcSpreadSheet1.SaveExcel(stream, GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX);
    //gcSpreadSheet1.SaveExcel(stream, GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, GrapeCity.Windows.SpreadSheet.Data.ExcelSaveFlags.DataOnly);
    //gcSpreadSheet1.SaveExcel(stream, GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, GrapeCity.Windows.SpreadSheet.Data.ExcelSaveFlags.DataOnly, "12Test9");
    //gcSpreadSheet1.SaveExcel(stream, GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, "12Test9");
    stream.Dispose();
}
Dim saveFileDialog = New SaveFileDialog()
saveFileDialog.Filter = "Excel File(.xlsx)|*.xlsx"
Dim useClick As Boolean = saveFileDialog.ShowDialog()
If (useClick = True) Then
    Dim stream = saveFileDialog.OpenFile()
    GcSpreadSheet1.SaveExcel(stream, GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX)
    'GcSpreadSheet1.SaveExcel(stream, GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, GrapeCity.Windows.SpreadSheet.Data.ExcelSaveFlags.DataOnly)
    'GcSpreadSheet1.SaveExcel(stream, GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, GrapeCity.Windows.SpreadSheet.Data.ExcelSaveFlags.DataOnly, "12Test9")
    'GcSpreadSheet1.SaveExcel(stream, GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, "12Test9")
End If
Requirements

Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

GcSpreadSheet Class
GcSpreadSheet Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.