ReportJsonSerializer
Serializes and deserializes objects into and from JSON. This class is dedicated for serializing and deserializing objects only from the Telerik.Reporting namespace.
Definition
Namespace:Telerik.Reporting.JsonSerialization
Assembly:Telerik.Reporting.JsonSerialization.dll
Syntax:
public class ReportJsonSerializer
Inheritance: objectReportJsonSerializer
Constructors
Initializes a new instance of the ReportJsonSerializer class.
public ReportJsonSerializer()
Methods
Deserializes the JSON document contained by the specified Stream.
public IReportDocument Deserialize(Stream stream)
The Stream that contains the JSON document to deserialize.
Returns:The Telerik.Reporting object being deserialized.
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 JSON string to a report document.
public IReportDocument Deserialize(string value)
The string that contains the JSON document.
Returns:The IReportDocument object being deserialized.
public IReportDocument Deserialize(TextReader reader)
Deserializes the JSON string to a specified instance of T.
public T Deserialize<T>(string value) where T : class
The string that contains the JSON document.
Returns:T
The Telerik.Reporting object being deserialized.
Serializes the specified value and writes the JSON document to the specified Stream.
public void Serialize(Stream stream, object value, Formatting formatting = 0)
The Stream used to write the JSON document.
valueobjectThe value to serialize.
formattingFormattingSpecifies formatting options for the JsonTextWriter. Default is Formatting.None.
Serializes the specified value and writes the JSON document to a file with the specified file name.
public void Serialize(string fileName, object value, Formatting formatting = 0)
The file which you want to write to. The ReportJsonSerializer creates a file at the specified path and writes to it in JSON text syntax. The fileName must be a file system path.
valueobjectThe value to serialize.
formattingFormattingSerializes the specified value and writes the JSON document to the specified TextWriter.
public void Serialize(TextWriter writer, object value, Formatting formatting = 0)
The TextWriter used to write the JSON document.
valueobjectThe value to serialize.
formattingFormattingSpecifies formatting options for the JsonTextWriter. Default is Formatting.None.