Registering a Data for the Dashboard
Our sample projects and report templates can help you learn the basics of working with our products.This example shows how to register data in the dashboard from code.
For example, we will load and register a JSON data file. To display a ready-made dashboard, we need a viewer. Add the
To register data in the dashboard, it is enough to call the special
In the screenshot below you can see the result of the sample code:

For example, we will load and register a JSON data file. To display a ready-made dashboard, we need a viewer. Add the
StiBlazorViewer component to the page.
@using Stimulsoft.Report.Blazor;
...
<StiBlazorViewer Report="@Report" />
...
To register data in the dashboard, it is enough to call the special
RegData() method, and specify the name of the data source, its alias, and pass the prepared DataSet object as parameters. To load a JSON file into a DataSet object, you can use a special StiJsonConnector class, which contains the necessary set of methods for conversion.
...
// Create empty dashboard object
this.Report = StiReport.CreateNewDashboard();
// Load dashboard template
this.Report.Load("Dashboards/Dashboard.mrt");
var jsonBytes = System.IO.File.ReadAllBytes("Dashboards/Demo.json");
var json = StiJsonConnector.Get();
var dataSet = json.GetDataSet(new StiJsonOptions(jsonBytes));
this.Report.Dictionary.Databases.Clear();
this.Report.RegData("Demo", "Demo", dataSet);
...In the screenshot below you can see the result of the sample code:
