Spread for ASP.NET 10 Product Documentation
SaveExcel Method


Saves the contents of the Spread component to the specified Excel file in a stream.
Saves the contents of the Spread component to Excel format (BIFF8).
Overload List
OverloadDescription
SaveExcel(Stream)Saves the contents of the Spread component to the specified Excel file in a stream.  
SaveExcel(Stream,String)Saves the contents of the Spread component to the specified Excel file in a stream.  
SaveExcel(Stream,ExcelWarningList)Saves the contents of the Spread component to the specified Excel file in a stream keeping track of warnings.  
SaveExcel(Stream,ExcelSaveFlags)Saves the contents of the Spread component with the specified parts to the specified Excel file in a stream.  
SaveExcel(Stream,ExcelSaveFlags,String)Saves the contents of the Spread component with the specified parts to the specified Excel file in a stream.  
SaveExcel(Stream,ExcelSaveFlags,ExcelWarningList)Saves the contents of the Spread component to the specified Excel file in a stream, keeping track of warnings.  
SaveExcel(Stream,ExcelSaveFlags,ExcelWarningList,String)Saves the contents of the Spread component to the specified Excel file in a stream, keeping track of warnings.  
SaveExcel(String)Saves the contents of the Spread component to Excel in the specified file.  
SaveExcel(String,String)Saves the contents of the Spread component to Excel in the specified file.  
SaveExcel(String,ExcelWarningList)Saves the contents of the Spread component to Excel in the specified file keeping track of warnings.  
SaveExcel(String,IncludeHeaders)Saves the contents of the Spread component to Excel in the specified file and whether to include headers.  
SaveExcel(String,IncludeHeaders,ExcelWarningList)Saves the contents of the Spread component to Excel in the specified file and whether to include headers and keeps track of warnings.  
SaveExcel(String,ExcelSaveFlags,ExcelWarningList)Saves the contents of the Spread component with the specified parts to Excel in the specified file keeping track of warnings.  
SaveExcel(String,ExcelSaveFlags,ExcelWarningList,String)Saves the contents of the Spread component with the specified parts to Excel in the specified file keeping track of warnings.  
SaveExcel(String,ExcelSaveFlags)Saves the contents of the Spread component to Excel in the specified file including the specified parts.  
SaveExcel(String,ExcelSaveFlags,String)Saves the contents of the Spread component to Excel in the specified file including the specified parts.  
Remarks

These methods provide various ways to save data to an Excel file. You can specify the path and file name, whether to include the headers, and a list of the warnings.

These methods save the contents of the sheets of the component to a Microsoft Excel-compatible BIFF (Binary Interchange File Format) file. BIFF8 (Binary Interchange File Format, version 8 from Microsoft) is the file format for several versions of Microsoft Excel (Excel 97, Excel 2000, and Excel XP). Use the UseOOXMLFormat option in the ExcelSaveFlags enumeration to save to the xlsx format.

Document caching (ExcelSaveFlags) allows users to open, edit, and save without the loss of advanced document content and formatting. The content can be lossless only if the opening file format is similar to the saving file format. If the advanced document content uses files besides the xls(x) file, then the additional files need to be in the same folder with the xls(x) file. Advanced content could be macros, ActiveX controls, data connections, etc.

In order to keep any document caching settings (changes would be lost during a postback), open the original file with the document caching only setting and then save the file using the document caching setting.

The memory stream must be able to seek when saving to a BIFF8 formatted file using a memory stream.

Make sure that none of the sheet names (SheetName property) have characters that are considered invalid sheet names in Excel. The following characters are invalid for Excel sheet names:

?     (question mark)
/     (forward slash)
\     (backward slash)
*     (asterisk)
[     (left bracket)
]     (right bracket)

Requirements

Target Platforms: Windows 7, Windows 8, Windows 10, Windows Vista, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows XP Professional

See Also

Reference

FpSpread Class
FpSpread Members

User-Task Documentation

Saving to an Excel-Formatted File

External

Microsoft Excel

 

 


Copyright © GrapeCity, inc. All rights reserved.