【发布时间】:2016-08-17 01:23:52
【问题描述】:
我在此代码末尾将 Hidden 属性设置为“True”,但是,它继续显示在 Report Manager 界面中。有谁知道如何使用带有 ReportService2010 的 PowerShell 设置此属性?
$reportServerUri = "http://local/ReportServer_SQL2014/ReportService2010.asmx?wsdl"
$rs = New-WebServiceProxy -Uri $reportServerUri -UseDefaultCredential
$proxyNamespace = $rs.GetType().Namespace
$targetFolderPath = "/My Reports"
$targetDatasourceRef = "/SharedDataSources/sdsHP"
$warnings = $null
$sourceFolderPath = "C:\Reports"
Get-ChildItem $sourceFolderPath -Recurse -Filter "*.rdl" | Foreach-Object {
$reportName = [System.IO.Path]::GetFileNameWithoutExtension($_.Name)
$bytes = [System.IO.File]::ReadAllBytes($_.FullName)
Write-Output "Uploading report ""$reportName"" to ""$targetFolderPath""..."
$report = $rs.CreateCatalogItem(
"Report", # Catalog item type
$reportName, # Report name
$targetFolderPath,# Destination folder
$true, # Overwrite report if it exists?
$bytes, # .rdl file contents
$null, # Properties to set.
[ref]$warnings) # Warnings that occured while uploading.
$warnings | ForEach-Object {
Write-Output ("Warning: {0}" -f $_.Message)
}
# Set the Hidden property of the reports.
$report.Hidden = "True"
$report.HiddenSpecified = "True"
}
【问题讨论】:
标签: powershell reporting-services ssrs-2014