【问题标题】:Moving from Reporting Services to SSDT从 Reporting Services 迁移到 SSDT
【发布时间】:2018-12-05 04:31:58
【问题描述】:

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

【问题讨论】:

    标签: reporting-services ssrs-2012 sql-server-data-tools


    【解决方案1】:

    基于https://github.com/Microsoft/Reporting-Services/blob/master/APISamples/powershell/powershellSamples.ps1 的示例使用powershell 进行的破解

    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)
    
    }
    

    【讨论】:

    • 我能够从目录数据库中提取报告。但是如何将它们导入 Visual Studio 解决方案?
    • 将文件夹结构复制到您的解决方案所在的位置。在 Windows 资源管理器中搜索所有 rdl 文件,然后将它们拖放到 VS 中的解决方案资源管理器中。我认为这应该有效
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多