New to Telerik ReportingStart a free 30-day trial

Serializes and deserializes objects into and from XML. This class is dedicated for serializing and deserializing objects only from the Telerik.Reporting namespace.

Definition

Namespace:Telerik.Reporting.XmlSerialization

Assembly:Telerik.Reporting.dll

Syntax:

C#
public class ReportXmlSerializer

Inheritance: objectReportXmlSerializer

Constructors

Initializes a new instance of the ReportXmlSerializer class.

C#
public ReportXmlSerializer()

Methods

Deserializes the XML document contained by the specified Stream.

C#
public object Deserialize(Stream stream)
Parameters:streamStream

The Stream that contains the XML document to deserialize.

Returns:

object

The Telerik.Reporting object being deserialized.

Remarks:

Use the stream parameter to specify an object that derives from the Stream class, which is designed to write to streams. Classes that derive from the Stream class include: BufferedStream, FileStream, MemoryStream, etc.

Deserializes the XML document from the specified URI.

C#
public object Deserialize(string inputUri)
Parameters:inputUristring

The URI for the file containing the XML data.

Returns:

object

The Telerik.Reporting object being deserialized.

Deserializes the XML document contained by the specified TextReader.

C#
public object Deserialize(TextReader reader)
Parameters:readerTextReader

The TextReader that contains the XML document to deserialize.

Returns:

object

The Telerik.Reporting object being deserialized.

Remarks:

Classes that inherit from TextReader include StringReader and StreamReader. If you are using a StreamReader to deserialize an object, you must construct the StreamReader with an appropriate Encoding. The encoding specified by the XML document is ignored.

Deserializes the XML document contained by the specified XmlReader.

C#
public object Deserialize(XmlReader reader)
Parameters:readerXmlReader

The XmlReader that contains the XML document to deserialize.

Returns:

object

The Telerik.Reporting object being deserialized.

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

C#
public void Serialize(Stream stream, object value)
Parameters:streamStream

The Stream used to write the XML document.

valueobject

The value to serialize.

Remarks:

Use the stream parameter to specify an object that derives from the abstract Stream class. Classes that derive from the Stream class include: BufferedStream, FileStream, MemoryStream, etc.

Serializes the specified value and writes the XML document to a file with the specified file name.

C#
public void Serialize(string fileName, object value)
Parameters:fileNamestring

The file which you want to write to. The ReportXmlSerializer creates a file at the specified path and writes to it in XML 1.0 text syntax. The fileName must be a file system path.

valueobject

The value to serialize.

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

C#
public void Serialize(TextWriter writer, object value)
Parameters:writerTextWriter

The TextWriter used to write the XML document.

valueobject

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.

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

C#
public void Serialize(XmlWriter writer, object value)
Parameters:writerXmlWriter

The XmlWriter used to write the XML document.

valueobject

The value to serialize.

Remarks:

In the xmlWriter parameter, specify an object that derives from the abstract XmlWriter class. For example you can use the XmlTextWriter class.