You can save the data or the data and formatting in an FpSpread component to a Spread XML file or to a stream. When you save, all sheets in the component are saved to the file or stream or a specific sheet can be saved. If you choose to save the formatting, the data saved includes formatting characters, such as currency symbols, and other information such as cell types are also saved.
You can also save a file from inside Spread Designer.
Refer to the SheetView class Save methods.
For instructions for opening Spread-compatible XML files, see Opening a Spread XML File.
Using Code
Use the FpSpread component’s Save method, specifying the path and file name of the Spread XML file to save or the Stream object to save, and whether to save data only or data and formatting.
Example
This example code saves the data and formatting in a component to an XML file.
C# | Copy Code |
---|---|
// Save the data and formatting to an XML file. FpSpread1.Save("C:\\savefile.xml", False); |
VB | Copy Code |
---|---|
' Save the data and formatting to an XML file. FpSpread1.Save("C:\savefile.xml", False) |
Using the Spread Designer
- Select the File menu.
- Choose the Save option.
The Save As dialog appears.
- For the Save As type, select Spread files (*.xml).
- Specify the path and file name to which to save the file, and then click Save.
If the file is saved successfully, a message appears stating the file has been saved.
- Click OK to close the Spread Designer.