How to pass JSON data in the Bold Reports® Report Viewer and Report Writer
To pass JSON data to the Bold Reports® Report Viewer or Report Writer, deserialize the JSON data into objects and add them as a ReportDataSource, as 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; }
}
To bind business object data to an RDLC report in the Report Viewer and Report Writer, see the following documentation.
Report Viewer
ASP.NET WebForms Report Viewer