Articles in this section
Category / Section

How to pass JSON data in the Bold Reports Report Viewer and Report Writer

Published:
Updated:

You have to Convert the objects from JSON data as shown in the following code example.

string json = System.IO.File.ReadAllText(@"<App Location>\App_Data\categories.json");
Categories Categories = JsonConvert.DeserializeObject<Categories>(json);

writer.DataSources.Clear();
writer.DataSources.Add(new ReportDataSource( Name = "Categories", Value = Categories.ToList()));

public class Categories : List<Category>
{

}

public class Category
{
  public int CategoryID { get; set; }
  public string Description { get; set; }
  public string Name { get; set; }
}

You can refer the following documentation for passing the business object data for RDLC report in the Report Viewer and Report Writer.

Report Viewer

JavaScript Report Viewer

ASP.NET WebForms Report Viewer

ASP.NET MVC Report Viewer

ASP.NET Core Report Viewer

Report Writer

ASP.NET Core Report Writer


Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied