This is a migrated thread and some comments may be shown as answers.

Telerik ReportView ready function

3 Answers 114 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 26 Jun 2015, 09:11 PM

Hello,

From my understanding I can pass a function into the ready option and it will run after the report viewer is initialized, so great - I though, because I would like for my reports to ignore the cache on a specific report.  So I figured I could do something to the effect of:

    $("#reportViewer1")
        .telerik_ReportViewer({
            serviceUrl: "/REST/api/reports/",
            templateUrl: '@Url.Content("~/ReportViewer/templates/telerikReportViewerTemplate-9.0.15.225.html")',
            reportSource: {
                report: "TravelRequestHeader.trdx",
                parameters: {
                    TravelRequestID: '@ViewBag.TravelRequestID'
                }
            },
            viewMode: telerikReportViewer.ViewModes.INTERACTIVE,
            ready: function () {
                //doesn't work right...
                this.refreshReport(true);
            }
        });

 

However the report viewer keeps rendering the report from cache, but if I do this explicitly within my dev console:

$('#reportViewer1').data('telerik_ReportViewer').refreshReport(true);

Then it will refresh the report and ignore the cache as I intended.  I do not see another option to set when initializing the viewer to tell to ignore the cache, am I missing something here?

 

Thanks,

Mike

3 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 29 Jun 2015, 08:36 AM
Hello Mike,

The event is called when the viewer object is ready, and it is not related to when the report in the viewer is rendered. The new IReportServiceConfiguration.ReportSharingTimeout Property (Q2 2015) allows you to control whether on each initial load of the viewer you will get a new instance of the report.

More details how to avoid the caching are available in Web Api Caching and resolving issues.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Michael
Top achievements
Rank 1
answered on 29 Jun 2015, 07:25 PM
Ah man that is a bummer, I was really hoping to be able to control this from the client side...is that not possible?  I would think that would be a valuable option to have.
0
Stef
Telerik team
answered on 30 Jun 2015, 09:48 AM
Hi Michael,

You can control the cache behavior from the client by always sending unique value for a report parameter. For example test the approach with the DateTime parameter discussed in Web Api Caching and resolving issues.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Michael
Top achievements
Rank 1
Answers by
Stef
Telerik team
Michael
Top achievements
Rank 1
Share this question
or