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
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
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?
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
Hi Silviay,
I have the same issue. Could you please provide an example how to pass DateTime.Now as report parameter value?
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
Silviya,
Thanks for your reply. But my problem was related with a custom resolver. And I fixed that.
Hi Oleg,
would you be kind to share your solution? Looks like I've the same problem.
Thank you