When I re-render a report after the underlying data has changed, I always see the table and chart with the data as it existed the FIRST time the report was rendered. I am destroying and recreating the Vue component each time I get the table data. Somehow, the table and chart never update with the new data, even though I see the JS object that is fed into readJson() has the new data. I only have this issue when the table/chart are in a dashboard in the mrt file, but not when they are in an actual report page. I need to use the dashboard, though, to get column filtering, auto-sizing, and other features only available when the elements are in a dashboard. How do I force a new table and chart to be created when the underlying data changes?
I am using version 2019.2.1 of stimulsoft.viewer.js, stimulsoft.reports.js, stimulsoft.dashboards.js, and stimulsoft.viewer.office2013.whiteblue.css.
My Vue component code is below. I have attached my mrt and json files. Thanks in advance for your help!
<template>
<div :id="viewerContentId">
</div>
</template>
<script lang="ts">
export default class ReportViewer extends Vue {
@Prop({ default: null })
templateFilePath: string;
viewerContentId: string = Math.random().toString(16).slice(2);
renderReportViewer (viewerData: ReportViewerData): void {
var stiDataSet = new Stimulsoft.System.Data.DataSet('ReportData');
stiDataSet.readJson(viewerData);
var stiReport = Stimulsoft.Report.StiReport.createNewDashboard();
stiReport.loadFile(this.templateFilePath);
stiReport.dictionary.databases.clear();
stiReport.regData(stiDataSet.dataSetName, null, stiDataSet);
stiReport.render();
var options = new Stimulsoft.Viewer.StiViewerOptions();
options.toolbar.visible = false;
options.appearance.pageBorderColor = Stimulsoft.System.Drawing.Color.empty;
var viewer = new Stimulsoft.Viewer.StiViewer(options, this.viewerContentId, false);
viewer.report = stiReport;
viewer.renderHtml(this.viewerContentId);
}
}
</script>
Rendered report with dashboard shows cached version of table/chart
-
- Posts: 1
- Joined: Fri Mar 01, 2019 7:12 pm
Rendered report with dashboard shows cached version of table/chart
- Attachments
-
- TemperatureHistory.json
- (1017 Bytes) Downloaded 153 times
-
- TemperatureHistory.mrt
- (10.69 KiB) Downloaded 144 times
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: Rendered report with dashboard shows cached version of table/chart
Hello,
Thank you for the detailed description. Please try to use the following code:
Also, we have added refreshViewer() method, will be available in the next release build:
Thank you.
Thank you for the detailed description. Please try to use the following code:
Code: Select all
Stimulsoft.Report.Dashboard.StiCacheCleaner.clean();
viewer.report = report;
Code: Select all
Stimulsoft.Report.Dashboard.StiCacheCleaner.clean();
viewer.refreshViewer();