How to refresh data in SSRS report accessed via ReportServer URL

牧云@^-^@ 提交于 2019-12-13 02:49:01

问题


I have a SSRS report that is accessed by users via the Web Service URL, we do this so we can pass in parameters.

e.g.

https://myserver.fqdn/ReportServer?/MyFolder/MyReport&rc:Toolbar=False&MyParameter=MyString

This works well the first time the report is accessed, but no amount of refreshing the browser will cause the data to refresh. I found I could fix this behavior by adding rs:ClearSession=True to the URL.

https://myserver.fqdn/ReportServer?/MyFolder/MyReport&rs:ClearSession=True&rc:Toolbar=False&myParameter=MyString

However this report also contains a number of Go to report actions. Clicking any of these actions strips the URL of the rs:ClearSession=True and now the reports contain old data.

Is there anyway to prevent the Web Service URL from doing any caching? This does not seem to be an issue when these reports are accessed via the Report Manager URL.

e.g.

https://myserver.fqdn/Reports/Pages/Report.aspx?ItemPath=%2fMyFolder%2fMyReport

回答1:


You can force the data to refresh by changing the value of a parameter.

You can exploit this by adding a hidden Date/Time parameter to each report. Within the Go to report action, assigning the new parameter a value of =Now() will change the value of this parameter each time the action is clicked.

This works even if you don't use the parameter in your report.



来源:https://stackoverflow.com/questions/59166315/how-to-refresh-data-in-ssrs-report-accessed-via-reportserver-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!