Registering a JSON Data for the Dashboard Template
Наши примеры проектов и шаблоны отчётов помогут Вам разобраться в основах работы с нашими продуктами.A JSON file can be embedded into the dashboard as a resource, so the template carries its own data.
Add the JSON as a dictionary resource.
How it works. The JSON travels inside the dashboard's dictionary, so the template is self-contained and needs no external data request.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:

Add the JSON as a dictionary resource.
var report = Stimulsoft.Report.StiReport.createNewDashboard();
var content = Stimulsoft.System.IO.File.getFile("../dashboard/Demo.json");
var resource = new Stimulsoft.Report.Dictionary.StiResource(
"DemoName", "DemoAlias", false,
Stimulsoft.Report.Dictionary.StiResourceType.Json, content);
report.dictionary.resources.add(resource);
designer.report = report;StiResource(name, alias, false, StiResourceType.Json, content)— wraps the JSON file as a report resource.report.dictionary.resources.add(resource)— embeds it so the dashboard renders from the bundled data.
How it works. The JSON travels inside the dashboard's dictionary, so the template is self-contained and needs no external data request.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:
