Spread for ASP.NET 7.0 Product Documentation
Serialize Method
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > ExcelSparkline Class : Serialize Method


w
XmlTextWriter object used to save the object

Glossary Item Box

Saves the object to XML.

Syntax

Visual Basic (Declaration) 
Public Overrides Function Serialize( _
   ByVal w As XmlTextWriter _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As ExcelSparkline
Dim w As XmlTextWriter
Dim value As Boolean
 
value = instance.Serialize(w)
C# 
public override bool Serialize( 
   XmlTextWriter w
)

Parameters

w
XmlTextWriter object used to save the object

Return Value

true if successful; false otherwise

Example

This example creates sparklines.
C#Copy Code
FarPoint.Web.Spread.ExcelSparkline es = new FarPoint.Web.Spread.ExcelSparkline(0, 5, this.fpSpread1.Sheets[0], new FarPoint.Web.Spread.Model.CellRange(0, 0, 1, 5));
string fileName = "c:\\ExcelSparkline.xml";
//Serialize
System.IO.Stream stream;
stream = System.IO.File.Open(fileName, System.IO.FileMode.Create);
System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter(stream, System.Text.Encoding.UTF8);
writer.Formatting = System.Xml.Formatting.Indented; writer.Indentation = 2;
writer.WriteStartDocument();
writer.WriteStartElement("ExcelSparkline");           
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Close();

//Deserialize
FarPoint.Web.Spread.ExcelSparkline es1 = new FarPoint.Web.Spread.ExcelSparkline();
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(fileName);
System.Xml.XmlNode node;
node = doc.FirstChild;
while (!node.Name.Equals("ExcelSparkline"))
    node = node.NextSibling;
System.Xml.XmlNodeReader r = new System.Xml.XmlNodeReader(node);
r.Read();
Visual BasicCopy Code
Dim es As New FarPoint.Web.Spread.ExcelSparkline(0, 5, fpSpread1.Sheets(0), New FarPoint.Web.Spread.Model.CellRange(0, 0, 1, 5))
Dim fileName As String = "c:\ExcelSparkline.xml"
'Serialize
Dim stream As System.IO.Stream
stream = System.IO.File.Open(fileName, System.IO.FileMode.Create)
Dim writer As New System.Xml.XmlTextWriter(stream, System.Text.Encoding.UTF8)
writer.Formatting = System.Xml.Formatting.Indented
writer.Indentation = 2
writer.WriteStartDocument()
writer.WriteStartElement("ExcelSparkline")
writer.WriteEndElement()
writer.WriteEndDocument()
writer.Close()

'Deserialize
Dim es1 As New FarPoint.Web.Spread.ExcelSparkline()
Dim doc As New System.Xml.XmlDocument()
doc.Load(fileName)
Dim node As System.Xml.XmlNode
node = doc.FirstChild
While Not node.Name.Equals("ExcelSparkline")
    node = node.NextSibling
End While
Dim r As New System.Xml.XmlNodeReader(node)
r.Read()

Requirements

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

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.