MESCIUS SPREAD for ASP.NET 10.0J
Serialize メソッド (ExcelSparklineSetting)

オブジェクトの保存に使用するXmlTextWriterオブジェクト
オブジェクトをXMLに保存します。
構文
'Declaration
 
Public Function Serialize( _
   ByVal w As XmlTextWriter _
) As Boolean
public bool Serialize( 
   XmlTextWriter w
)

パラメータ

w
オブジェクトの保存に使用するXmlTextWriterオブジェクト

戻り値の型

成功した場合はTrue、それ以外の場合はFalse
次のサンプルコードは、スパークラインを作成します。
FarPoint.Web.Spread.ExcelSparklineSetting eSetting = new FarPoint.Web.Spread.ExcelSparklineSetting();
eSetting.ShowMarkers = true;
eSetting.AxisColor = Color.Cyan;
eSetting.DisplayEmptyCellsAs = FarPoint.Web.Spread.Chart.EmptyValueStyle.Gaps;
eSetting.DisplayHidden = true;
eSetting.DisplayXAxis = true;
eSetting.FirstMarkerColor = Color.AliceBlue;
eSetting.Formula = "Sheet1!$A$4:$E$4";
eSetting.HighMarkerColor = Color.Honeydew;
eSetting.LastMarkerColor = Color.Lavender;
eSetting.LineWeight = 2;
eSetting.LowMarkerColor = Color.LawnGreen;
eSetting.ManualMax = 3;
eSetting.ManualMin = 1;
eSetting.MarkersColor = Color.Magenta;
eSetting.MaxAxisType = FarPoint.Web.Spread.SparklineAxisMinMax.Custom;
eSetting.MinAxisType = FarPoint.Web.Spread.SparklineAxisMinMax.Individual;
eSetting.NegativeColor = Color.NavajoWhite;
eSetting.RightToLeft = true;
eSetting.SeriesColor = Color.SeaGreen;
eSetting.ShowFirst = true;
eSetting.ShowHigh = true;
eSetting.ShowLast = true;
eSetting.ShowLow = true;
eSetting.ShowNegative = true;

FarPoint.Web.Spread.ExcelSparklineSetting ess = eSetting;
string fileName = "c:\\ExcelSparklineSetting.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("ExcelSparklineSetting");
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Close();

//Deserialize
FarPoint.Web.Spread.ExcelSparklineSetting ess1 = new FarPoint.Web.Spread.ExcelSparklineSetting();
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(fileName);
System.Xml.XmlNode node;
node = doc.FirstChild;
while (!node.Name.Equals("ExcelSparklineSetting"))
    node = node.NextSibling;
System.Xml.XmlNodeReader r = new System.Xml.XmlNodeReader(node);
r.Read();
Dim eSetting As New FarPoint.Web.Spread.ExcelSparklineSetting()
eSetting.ShowMarkers = True
eSetting.AxisColor = Color.Cyan
eSetting.DisplayEmptyCellsAs = FarPoint.Web.Spread.Chart.EmptyValueStyle.Gaps
eSetting.DisplayHidden = True
eSetting.DisplayXAxis = True
eSetting.FirstMarkerColor = Color.AliceBlue
eSetting.Formula = "Sheet1!$A$4:$E$4"
eSetting.HighMarkerColor = Color.Honeydew
eSetting.LastMarkerColor = Color.Lavender
eSetting.LineWeight = 2
eSetting.LowMarkerColor = Color.LawnGreen
eSetting.ManualMax = 3
eSetting.ManualMin = 1
eSetting.MarkersColor = Color.Magenta
eSetting.MaxAxisType = FarPoint.Web.Spread.SparklineAxisMinMax.[Custom]
eSetting.MinAxisType = FarPoint.Web.Spread.SparklineAxisMinMax.Individual
eSetting.NegativeColor = Color.NavajoWhite
eSetting.RightToLeft = True
eSetting.SeriesColor = Color.SeaGreen
eSetting.ShowFirst = True
eSetting.ShowHigh = True
eSetting.ShowLast = True
eSetting.ShowLow = True
eSetting.ShowNegative = True

Dim ess As FarPoint.Web.Spread.ExcelSparklineSetting = eSetting
Dim fileName As String = "c:\ExcelSparklineSetting.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("ExcelSparklineSetting")
writer.WriteEndElement()
writer.WriteEndDocument()
writer.Close()

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

ExcelSparklineSetting クラス
ExcelSparklineSetting メンバ

 

 


© MESCIUS inc. All rights reserved.