Reporting services 从报告服务转向SSDT

Reporting services 从报告服务转向SSDT,reporting-services,ssrs-2012,sql-server-data-tools,Reporting Services,Ssrs 2012,Sql Server Data Tools,我们正在将SSRS报告从报告服务转移到2017年SSDT。有数千个文件夹。如何在不手动创建文件夹结构的情况下将这些文件夹和.rdl文件导入到SSDT中?基于 我能够从目录数据库中调出报告。但是如何将它们导入Visual Studio解决方案?将文件夹结构复制到解决方案所在的位置。在windows资源管理器中搜索所有rdl文件,然后将它们拖放到VS中的解决方案资源管理器中。我认为这样应该可以 Import-Module SqlServer $targetReportDirectory = "c:

我们正在将SSRS报告从报告服务转移到2017年SSDT。有数千个文件夹。如何在不手动创建文件夹结构的情况下将这些文件夹和.rdl文件导入到SSDT中?

基于


我能够从目录数据库中调出报告。但是如何将它们导入Visual Studio解决方案?将文件夹结构复制到解决方案所在的位置。在windows资源管理器中搜索所有rdl文件,然后将它们拖放到VS中的解决方案资源管理器中。我认为这样应该可以
Import-Module SqlServer

$targetReportDirectory = "c:\temp\rs" #where to put the files

If (-Not (Test-Path $targetReportDirectory)) {new-Item -Path $targetReportDirectory -ItemType directory -Force}

#recreate directory structure on disk
Invoke-Sqlcmd -ServerInstance localhost -Database ReportServer -Query "Select Path from [Catalog] Where Type = 1 and Nullif(Path, '') is not null --Folders" | ForEach {
    $localpath = Join-Path $targetReportDirectory $_.Path 

    If (-Not (Test-Path $localpath)) {$f = new-Item -Path $localpath -ItemType directory -Force}

}


#pull all reports down
$ReportPortalUri = "http://localhost/Reports"
Invoke-Sqlcmd -ServerInstance localhost -Database ReportServer -Query "Select ItemID, Path from [Catalog] Where Type = 2 and Nullif(Path, '') is not null --Reports" | ForEach {

    $catalogItemsApi = $ReportPortalUri + "/api/v1.0/catalogitems($($_.ItemID))/Content/`$value"
    $response = Invoke-WebRequest -Uri $catalogItemsApi -Method Get -UseDefaultCredentials
    $downloadPath = Join-Path $targetReportDirectory $($_.Path + ".rdl")
    [System.IO.File]::WriteAllBytes($downloadPath, $response.Content)

}