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


GrapeCity.Windows.SpreadSheet.UI Namespace > GcSpreadSheet Class > SaveExcel Method : SaveExcel(String,ExcelFileFormat,ExcelSaveFlags,String) Method
The saved file path.
The excel file format.
The flag used to save the file.
The file password.
Saves GcSpreadSheet to an Excel Compound Document File.
Syntax
'Declaration
 
Public Overloads Sub SaveExcel( _
   ByVal file As System.String, _
   ByVal format As ExcelFileFormat, _
   ByVal saveFlags As ExcelSaveFlags, _
   ByVal password As System.String _
) 
'Usage
 
Dim instance As GcSpreadSheet
Dim file As System.String
Dim format As ExcelFileFormat
Dim saveFlags As ExcelSaveFlags
Dim password As System.String
 
instance.SaveExcel(file, format, saveFlags, password)
public void SaveExcel( 
   System.string file,
   ExcelFileFormat format,
   ExcelSaveFlags saveFlags,
   System.string password
)

Parameters

file
The saved file path.
format
The excel file format.
saveFlags
The flag used to save the file.
password
The file password.
Example
This example uses the SaveExcel method.
gcSpreadSheet1.Sheets[0].ColumnHeader.Columns[0].Label = "Label";
gcSpreadSheet1.Sheets[0].Cells[0, 0, 2, 2].Text = "test";           
gcSpreadSheet1.Invalidate();

 private void button1_Click(object sender, RoutedEventArgs e)
        {
//gcSpreadSheet1.SaveExcel("c:\\zipfile\\test.xlsx", GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX);
//gcSpreadSheet1.SaveExcel("c:\\zipfile\\test.xlsx", GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, "1NaMe5");
//gcSpreadSheet1.SaveExcel("c:\\zipfile\\test.xlsx", GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, GrapeCity.Windows.SpreadSheet.Data.ExcelSaveFlags.SaveBothCustomRowAndColumnHeaders);
gcSpreadSheet1.SaveExcel("c:\\zipfile\\test.xlsx", GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, GrapeCity.Windows.SpreadSheet.Data.ExcelSaveFlags.SaveBothCustomRowAndColumnHeaders, "1NaMe5");
gcSpreadSheet1.Invalidate();
        }
GcSpreadSheet1.Sheets(0).ColumnHeader.Columns(0).Label = "Label"
GcSpreadSheet1.Sheets(0).Cells(0, 0, 2, 2).Text = "test"           
GcSpreadSheet1.Invalidate()

Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
GcSpreadSheet1.SaveExcel("c:\zipfile\test.xlsx", GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX)
'GcSpreadSheet1.SaveExcel("c:\zipfile\test.xlsx", GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, "1NaMe5")
'GcSpreadSheet1.SaveExcel("c:\zipfile\test.xlsx", GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, GrapeCity.Windows.SpreadSheet.Data.ExcelSaveFlags.SaveBothCustomRowAndColumnHeaders)
'GcSpreadSheet1.SaveExcel("c:\zipfile\test.xlsx", GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, GrapeCity.Windows.SpreadSheet.Data.ExcelSaveFlags.SaveBothCustomRowAndColumnHeaders, "1NaMe5")
'GcSpreadSheet1.Invalidate()
End Sub
See Also

Reference

GcSpreadSheet Class
GcSpreadSheet Members
Overload List