Updating a JSON Data for the Dashboard Viewer
Our sample projects and report templates can help you learn the basics of working with our products.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.