Progress® Telerik® Reporting R2 2017

ReportXmlSerializerDeserialize Method (TextReader)

Deserializes the XML document contained by the specified TextReader.

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

Syntax

public Object Deserialize(
	TextReader reader
)

Parameters

reader
Type: System.IOTextReader
The TextReader that contains the XML document to deserialize.

Return Value

Type: 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.

Examples

The following example deserializes an object using a TextReader:
using (System.IO.FileStream fileStream = new System.IO.FileStream("Report1.xml", System.IO.FileMode.Open, System.IO.FileAccess.Read))
using (System.IO.TextReader textReader = new System.IO.StreamReader(fileStream))
{
    Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer =
        new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();

    Telerik.Reporting.Report report = (Telerik.Reporting.Report)
        xmlSerializer.Deserialize(textReader);
}

See Also