Progress® Telerik® Reporting R3 2017

ReportXmlSerializerSerialize Method (TextWriter, Object)

Serializes the specified value and writes the XML document to the specified TextWriter.

Namespace:  Telerik.Reporting.XmlSerialization
Assembly:  Telerik.Reporting (in Telerik.Reporting.dll)

Syntax

public void Serialize(
	TextWriter writer,
	Object value
)

Parameters

writer
Type: System.IOTextWriter
The TextWriter used to write the XML document.
value
Type: SystemObject
The value to serialize.

Remarks

In the textWriter parameter, specify an object that derives from the abstract TextWriter class. Classes that derive from the TextWriter class include: StreamWriter, StringWriter, etc.

Examples

The following examples serializes an object using a TextWriter:
using (System.IO.FileStream fs = new System.IO.FileStream("Report.xml", FileMode.Create))
using (System.IO.TextWriter writer = new System.IO.StreamWriter(fs, System.Text.Encoding.UTF8))
{
    Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer =
        new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();

    xmlSerializer.Serialize(writer, report);
}

See Also