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

How to Disable Caching

7 Answers 737 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Fernando
Top achievements
Rank 1
Fernando asked on 22 Jul 2015, 02:02 PM

good morning

When I run a report in this reportViewer generating a cache of information.

When I change the value of information in the database and run the report again, the report is still with the old information.

 

 $("#reportViewer1").telerik_ReportViewer({
            serviceUrl: "api/ReportClient",
            templateUrl: "Content/reports/templates/telerikReportViewerTemplate-9.0.15.324.html",
            reportSource: {
                report: "{ id : 81 }",
                viewMode: telerikReportViewer.ViewModes.PRINT_PREVIEW,
                scaleMode: telerikReportViewer.ScaleModes.FIT_PAGE_WIDTH,
                scale: 1.0,
                PersistSession: false
            }
        });       
    });​

 

//SERVICE

 public class ReportClientController : ReportsControllerBase
    {
        protected override IReportResolver CreateReportResolver()
        {
            return new ClientReportResolver();
        }
        protected override ICache CreateCache()
        {

            var cache =     Telerik.Reporting.Services.Engine.CacheFactory.CreateFileCache(HttpContext.Current.Server.MapPath("~/App_Data/CustomReports/cache"));
    return cache;
        }​

 

I've tried removing the overhead of the method but the reportViewr exisge this overload

 

7 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 27 Jul 2015, 07:47 AM
Hello Fernando,

Please test the suggestions listed in my posts in the Web Api Caching and resolving issues forum thread.

Let us know if you need any further help.

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
Naveen
Top achievements
Rank 1
answered on 24 Oct 2018, 05:14 PM

Hi Stef,

I'm trying to disable report caching in my Telerik report Web API and i did refer to "Web API Caching and resolving issues" forum thread. But, I guess most of the information provided there is to set time outs to avoid cached reports or set a Data-time parameter to create a new report every-time.

But is there a way to avoid the caching at all?

0
Silviya
Telerik team
answered on 29 Oct 2018, 09:53 AM
Hi Naveen,

Can you please elaborate about the reason of fully disabling caching?

However, in order to force the service to render the report each time anew instead of returning its cached version, you need to pass a different report parameter value. A possible workaround is to pass a DateTime.Now or another unique value via a report parameter (hidden), which will guarantee that the report is processed each time it is requested.

Regards,
Silviya
Progress 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
Ilya
Top achievements
Rank 1
answered on 28 Jan 2019, 08:41 AM

Hi Silviay,

I have the same issue. Could you please provide an example how to pass DateTime.Now as report parameter value?

0
Silviya
Telerik team
answered on 30 Jan 2019, 03:50 PM
Hi Ilya,

You could pass a built-in function =Now() as value of the report parameter. For more information - Date and Time Functions.
Please check this screen shot for reference - https://www.screencast.com/t/0tZixwWvh.

Regards,
Silviya
Progress 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
Oleg Kokorin
Top achievements
Rank 1
answered on 31 Jan 2019, 09:44 AM

Silviya,

 

Thanks for your reply. But my problem was related with a custom resolver. And I fixed that.

0
Iurii
Top achievements
Rank 1
answered on 11 Jul 2019, 05:54 PM

Hi Oleg,

 

would you be kind to share your solution? Looks like I've the same problem.

Thank you

Tags
General Discussions
Asked by
Fernando
Top achievements
Rank 1
Answers by
Stef
Telerik team
Naveen
Top achievements
Rank 1
Silviya
Telerik team
Ilya
Top achievements
Rank 1
Oleg Kokorin
Top achievements
Rank 1
Iurii
Top achievements
Rank 1
Share this question
or