rdl.data文件并非在服务器上创建 - 它们仅用于在开发期间加快报告执行时间,当您反复运行具有相同参数的报告并调整布局时。
顺便说一句,我相信可以配置SSRS服务缓存结果以便重用。
我不知道服务使用的缓存机制的详细信息;它可能使用像rdl.data一样的基于文件的机制,也可能将结果存储在ReportingServices数据库之一中。
也许了解更多关于SSRS的人可以确认机制的详细信息。
在开发中,您可以通过编辑设计器配置文件来关闭缓存(并消除 *.rdl.data 文件)。
对于 SQL Server 2008 SSRS,其默认位置为:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\RSReportDesigner.config
将 CacheDataForPreview 更改为“false”。
源链接 http://blog.summitcloud.com/2010/05/disable-reporting-services-data-cache-in-development/
我不确定zomf的答案是否可行(微软也持相同观点)。理论上听起来不错,但实际上似乎并不起作用。
我认为最简单的方法是接受这些文件。如果你感到困扰,可以将你创建的每个报告的AutoRefresh属性设置为1秒钟(虽然令人烦恼的闪烁效果和对服务器的负载可能使得这个选项不可行)。
否则,在预览报告时只需点击REFRESH按钮即可。
另外一个选择可能是为报表创建虚拟参数,并在每次运行时生成随机值。由于SSRS仅在输入参数组合与上一次运行报告时相同时显示缓存数据,因此这可能解决问题。但我尚未在实践中进行过测试。
PowerShell 来拯救,只需隐藏它 - 将 PowerShell 项目添加到您的报表解决方案中,并将其设置为构建配置中的启动项目:
$path = "../*.rdl.data"
$rdlDataFiles = Get-ChildItem -Recurse -Force -Path "$path";
Write-Output "$path"
$rdlDataFiles | ForEach-Object {
Write-Output "Hiding *.rdl.data file $_"
$_.Attributes = $_.Attributes -bor (([System.IO.FileAttributes]::Hidden))
# Next line isn't required per say, but just a guard.
$_.Attributes = $_.Attributes -bor (-bnot([System.IO.FileAttributes]::ReadOnly))
}
bin/
目录下,然后当它们不再在项目中时没有被删除,导致依赖它的报告在本地测试期间失败。太可怕了。 - Tim Abell