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
ASP.NET WebForms Report Viewer