Updating a JSON Data for the Dashboard Viewer
Наши примеры проектов и шаблоны отчётов помогут Вам разобраться в основах работы с нашими продуктами.The dashboard's data can be replaced at run time — re-register a fresh dataset and clear the cache so the viewer rebuilds.
Register new data and refresh.
How it works. Re-registering data and clearing the cache forces a rebuild, so the dashboard reflects updated values without reloading the page.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:

Register new data and refresh.
function setData() {
var jsonData = JSON.parse(jsonString.value);
var dataSet = new Stimulsoft.System.Data.DataSet("Demo");
dataSet.readJson(jsonData);
report.regData("Demo", "Demo", dataSet);
Stimulsoft.Report.Dashboard.StiCacheCleaner.clean();
viewer.report = report;
}dataSet.readJson(object)+regData— bind a dataset built from an in-memory JSON object.StiCacheCleaner.clean()— clears the dashboard cache so the viewer re-renders with the new data.
How it works. Re-registering data and clearing the cache forces a rebuild, so the dashboard reflects updated values without reloading the page.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:
