skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Use Reports in Applications
    • System Requirements
    • Forums
    • Videos
    • Blogs
    • Submit a Ticket
    • FAQs
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now
Search all

Class ReportJsonSerializer

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

Inheritance
System.Object
ReportJsonSerializer
Namespace: Telerik.Reporting.JsonSerialization
Assembly: Telerik.Reporting.JsonSerialization.dll

Syntax

public class ReportJsonSerializer

Constructors

ReportJsonSerializer()

Initializes a new instance of the ReportJsonSerializer class.

Declaration
public ReportJsonSerializer()

Methods

Deserialize(Stream)

Deserializes the JSON document contained by the specified System.IO.Stream.

Declaration
public IReportDocument Deserialize(Stream stream)
Parameters
System.IO.Stream stream

The System.IO.Stream that contains the JSON document to deserialize.

Returns
IReportDocument

The Telerik.Reporting object being deserialized.

Remarks

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

Examples

The following example deserializes an object using a System.IO.Stream:

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.String value

The string that contains the JSON document.

Returns
IReportDocument

The IReportDocument object being deserialized.

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.String value

The string that contains the JSON document.

Returns
T

The Telerik.Reporting object being deserialized.

Type Parameters
T

Serialize(TextWriter, Object, Formatting)

Serializes the specified value and writes the JSON document to the specified System.IO.TextWriter.

Declaration
public void Serialize(TextWriter writer, object value, Formatting formatting)
Parameters
System.IO.TextWriter writer

The System.IO.TextWriter used to write the JSON document.

System.Object value

The value to serialize.

Newtonsoft.Json.Formatting formatting

Specifies formatting options for the JsonTextWriter. Default is Formatting.None.

Getting Started
  • Install Now
  • Online Demos
Support Resources
  • Documentation
  • Knowledge Base
  • Videos
  • Reporting Samples Repository
  • Reporting Release History
Community
  • Forums
  • Blogs
  • Reporting Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.