我是 SSRS 部署的新手,我一直在四处寻找,但无法找到适用于我的情况的确切场景。我在 SSRS 2012 的不同子文件夹中部署了几个报告。例如:
由于有时 SSRS 不喜欢覆盖的报告文件,我想在部署任何新报告之前删除实例中的所有报告文件。通过使用 rs.exe 调用此脚本,我可以成功删除文件夹及其内容:
Public Sub Main()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim bh As New BatchHeader()
bh.BatchID = rs.CreateBatch()
rs.BatchHeaderValue = bh
'Delete all reports from Main Folder and sub folders.Note:The Folders will be deleted also.
'If do not want to delete the folder, we could use rs.CreateFolder(“Folder name”, “/Main Folder”, “nothing”) to create a new one with nothing.
rs.DeleteItem("/Sales")
rs.DeleteItem("/Finance")
rs.DeleteItem("/Misc")
'Delete all reports from a sub …
Run Code Online (Sandbox Code Playgroud)