Spread Silverlight Documentation
SaveXml(XmlWriter,Boolean) Method
Example 


The XML writer.
Specifies whether to only save data.
Saves the worksheet to an XML writer.
Syntax
'Declaration
 
Public Overloads Sub SaveXml( _
   ByVal writer As System.Xml.XmlWriter, _
   ByVal dataOnly As System.Boolean _
) 
'Usage
 
Dim instance As Worksheet
Dim writer As System.Xml.XmlWriter
Dim dataOnly As System.Boolean
 
instance.SaveXml(writer, dataOnly)
public void SaveXml( 
   System.Xml.XmlWriter writer,
   System.bool dataOnly
)

Parameters

writer
The XML writer.
dataOnly
Specifies whether to only save data.
Example
This example uses the SaveXml method.
SaveFileDialog saveFileDialog = new 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 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
Requirements

Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

Worksheet Class
Worksheet Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.