I have a Web Api project with Telerik reporting, and a client Angular site that hosts the reportviewer.
The reports are triggered by a button on the angular app, which opens a new window which hosts the reportviewer,
The initial call to the report Web Api works as expected, the data is read from the database using an object datasource and the report is displayed.
If I then change the values in the database and click the browser refresh button, or the button that fired the report, I get the report with the old values being displayed. I have also tried modifying the report by adding new labels, recompiling the Wep Api project and refreshing, but I still get the old report showing.
If I click the refresh button on the report viewer, the report is refreshed correctly.
I initially thought this may have something tho do with the ReportsController in the Web Api as described in this thread, but I have the same symptoms irrespective of whether I override CreateCache with a File case or a database cache, or override CreateStorage with a MsSqlServerStorage.
I ran a Fiddler trace and noticed that when I clicked the report button a second time (or clicked the browser refresh button) the call to
GET /api/reports/clients/114416-a7b5/instances/112216-ebd8/documents/113600-3f1a113600-57c1/info returned
{
"documentReady"
:
true
,
"pageCount"
: 1,
"documentMapAvailable"
:
false
,
"bookmarkNodes"
:
null
}
and when I clicked the refresh button on the report viewer it returned
{
"documentReady"
:
false
,
"pageCount"
: 0,
"documentMapAvailable"
:
false
,
"bookmarkNodes"
:
null
}
after this the call was made a second time and returned
{
"documentReady"
:
true
,
"pageCount"
: 1,
"documentMapAvailable"
:
false
,
"bookmarkNodes"
:
null
}
and the report was rendered with the correct data.
I also noticed that if I recycle the app pool, the report is rendered correctly, which points to something being cached in session. This is odd as the Web Api project has session state disabled.
What do I need to do to get the report to be re rendered every time?
Regards
Colin