Spread WPF Documentation
SaveXml(XmlWriter) Method
Example 


GrapeCity.Windows.SpreadSheet.Data Namespace > Worksheet Class > SaveXml Method : SaveXml(XmlWriter) Method
The XML writer.
Saves the worksheet to an XML writer.
Syntax
'Declaration
 
Public Overloads Sub SaveXml( _
   ByVal writer As System.Xml.XmlWriter _
) 
'Usage
 
Dim instance As Worksheet
Dim writer As System.Xml.XmlWriter
 
instance.SaveXml(writer)
public void SaveXml( 
   System.Xml.XmlWriter writer
)

Parameters

writer
The XML writer.
Example
This example uses the SaveXml method.
Microsoft.Win32.SaveFileDialog saveFileDialog = new Microsoft.Win32.SaveFileDialog();
saveFileDialog.Filter = "Xml File (.xml)|*.xml";
bool? useClick = saveFileDialog.ShowDialog();
if (useClick == true)
{
    var stream = saveFileDialog.OpenFile();
    System.Xml.XmlWriter xr = System.Xml.XmlWriter.Create(stream);
    gcSpreadSheet1.Sheets[0].SaveXml(xr, true);    
    //gcSpreadSheet1.Sheets[0].SaveXml(xr);    
    stream.Dispose();
}
Dim saveFileDialog = New Microsoft.Win32.SaveFileDialog()
saveFileDialog.Filter = "Xml File(.xml)|*.xml"
Dim useClick As Boolean = saveFileDialog.ShowDialog()
If (useClick = True) Then
    Dim stream = saveFileDialog.OpenFile()
    stream.Seek(0, IO.SeekOrigin.Begin)
    Dim xr As System.Xml.XmlWriter = System.Xml.XmlWriter.Create(stream)
    GcSpreadSheet1.Sheets(0).SaveXml(xr, True)
    'GcSpreadSheet1.Sheets(0).SaveXml(xr)
End If
See Also

Reference

Worksheet Class
Worksheet Members
Overload List