Class ReportJsonSerializer
Serializes and deserializes objects into and from JSON.
This class is dedicated for serializing and deserializing objects
only from the Telerik.
Inheritance
Namespace: Telerik.Reporting.JsonSerialization
Assembly: Telerik.Reporting.JsonSerialization.dll
Syntax
public class ReportJsonSerializer
Constructors
ReportJsonSerializer()
Initializes a new instance of the Report
Declaration
public ReportJsonSerializer()
Methods
Deserialize(Stream)
Deserializes the JSON document contained by the specified System.
Declaration
public IReportDocument Deserialize(Stream stream)
Parameters
System. The System. |
Returns
IReport The Telerik. |
Remarks
Use the stream parameter to specify an object that derives from the System.
Examples
The following example deserializes an object using a System.
using (System.IO.FileStream fileStream = new System.IO.FileStream("Report1.xml", System.IO.FileMode.Open, System.IO.FileAccess.Read))
{
Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer =
new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();
Telerik.Reporting.Report report = (Telerik.Reporting.Report)
xmlSerializer.Deserialize(fileStream);
}
Using fileStream As New System.IO.FileStream("Report1.xml", System.IO.FileMode.Open, System.IO.FileAccess.Read)
Dim xmlSerializer As New Telerik.Reporting.XmlSerialization.ReportXmlSerializer()
Dim report As Telerik.Reporting.Report = DirectCast(xmlSerializer.Deserialize(fileStream), Telerik.Reporting.Report)
End Using
Deserialize(String)
Deserializes the JSON string to a report document.
Declaration
public IReportDocument Deserialize(string value)
Parameters
System. The string that contains the JSON document. |
Returns
IReport The IReport |
Deserialize<T>(String)
Deserializes the JSON string to a specified instance of T.
Declaration
public T Deserialize<T>(string value)
where T : class
Parameters
System. The string that contains the JSON document. |
Returns
T
The Telerik. |
Type Parameters
T
|
Serialize(TextWriter, Object, Formatting)
Serializes the specified value and writes the JSON document to the specified System.
Declaration
public void Serialize(TextWriter writer, object value, Formatting formatting)
Parameters
System. The System. |
System. The value to serialize. |
Newtonsoft. Specifies formatting options for the JsonTextWriter. Default is Formatting.None. |