# Saving to a Spread XML File

Learn how to save data and formatting in a Spread component to a Spread XML file or stream with the methods provided in the FpSpread class or the SheetView class.

## Content

You can save the data or the data and formatting in a Spread component to a Spread XML file or to a stream. All sheets in the component are saved to the file or stream if you use the [Save](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.Save.html) method in the FpSpread class. If you choose to save the formatting, the saved data includes formatting characters, such as currency symbols, and other information such as cell types.
For more details on the methods used, refer to the [Save](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.Save.html) methods in the [FpSpread](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.html) class or the [SaveXml](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.SaveXml.html) methods in the [SheetView](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.html) class.
For instructions for opening Spread-compatible XML files, see [Opening a Spread XML File](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-usefiles/spwin-openfiles/spwin-open-spreadxmldatafile).

## Using Code

Use the [Save](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.Save.html) method of the [FpSpread](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.html) component to specify the path and file name of the Spread XML file or the Stream object, and whether to save data only.

## Example

This example code saves the data and formatting in a Spread component to a Spread XML file.

```csharp
// Save the data and formatting to an XML file.
fpSpread1.Save("C:\\SpWinFile1.xml", false);
```

```vbnet
' Save the data and formatting to an XML file.
fpSpread1.Save("C:\SpWinFile1.xml", False)
```

## Using the Spread Designer

1. From the **File** menu, choose **Save**.
<br>
    The **Save As** dialog appears.
2. Change the **Save as** type box to XML files (\*.xml).
3. 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.
4. Click **OK** to close the Spread Designer.

## See Also

[Saving to a PDF File](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-usefiles/spwin-savefiles/spwin-save-pdffile)
[Saving to an Excel File](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-usefiles/spwin-savefiles/spwin-save-excelfile)
[Saving to a Text File](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-usefiles/spwin-savefiles/spwin-save-texttfile)
[Storing Excel Summary and View](/spreadnet/docs/latest/online-win/overview/spwin-devguide/StoringExcelSummaryandView)
[Saving to an HTML Table](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-usefiles/spwin-savefiles/spwin-save-htmltable)
[Saving Spreadsheet Data to Simple XML](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-usefiles/spwin-savefiles/spwin-save-dataxml)