0

我建立的設置來部署我的SSRS通過八達通部署報表發佈SSRS,我發現了一個Octopus Library,我的工作就可以了,但我有一些問題:八達通

1° - ---消息錯誤:(路徑沒問題,但它保持相同的警告) 警告:無法在銷售驅動程序/數據源中找到數據源SalesDrivers

2º----該方法不存在 方法調用失敗,因爲[Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy3er_ReportService2005_asmx_wsdl.ReportingService2005]不包含名爲「LoadReportDefinition」的方法。

從拋出錯誤模板\庫PowerShell的功能可以得到如下圖所示:

#region Update-ReportParamters() 
Function Update-ReportParameters($ReportFile) 
{ 
    # declare local variables 
    $ReportParameters = @(); 

    # necessary so that when attempting to use the report execution service, it doesn't puke on you when it can't find the data source 
    $ReportData = (Remove-SharedReferences -ReportFile $ReportFile) 

    # get just the report name 
    $ReportName = $ReportFile.SubString($ReportFile.LastIndexOf("\") + 1) 
    $ReportName = $ReportName.SubString(0, $ReportName.IndexOf(".")) 

    # create warnings object 
    $ReportExecutionWarnings = $null 

    # load the report definition 
    Write-Host "*********************************************" 

    #Write-Host $ReportData 
    #(Remove-SharedReferences -ReportFile $ReportFile) 

    #Write-Host $ReportExecutionWarnings 

    $ExecutionInfo = $ReportExecutionProxy.LoadReportDefinition($ReportData, [ref] $ReportExecutionWarnings); 

    # loop through the report execution parameters 
    foreach($Parameter in $ExecutionInfo.Parameters) 
    { 
     # create new item parameter object 
     $ItemParameter = New-Object "$ReportServerProxyNamespace.ItemParameter"; 

     # fill in the properties except valid values, that one needs special processing 
     Copy-ObjectProperties -SourceObject $Parameter -TargetObject $ItemParameter; 

     # fill in the valid values 
     $ItemParameter.ValidValues = Convert-ValidValues -SourceValidValues $Parameter.ValidValues; 

     # add to list 
     $ReportParameters += $ItemParameter; 
    } 

    # force the parameters to update 
    Write-Host "Updating report parameters for $ReportFolder/$ReportName" 
    if ($IsReportService2005) { 
     $ReportServerProxy.SetReportParameters("$ReportFolder/$ReportName", $ReportParameters); 
    } 
    elseif ($IsReportService2010) { 
     $ReportServerProxy.SetItemParameters("$ReportFolder/$ReportName", $ReportParameters); 
    } 
    else { Write-Warning 'Report Service Unknown in Update-ReportParameters method. Use ReportService2005 or ReportService2010.' } 
} 

任何人都知道我怎麼會整理出來?

回答

0

我已經解決了類似的問題,但採取了稍微不同的方法。我沒有直接使用powershell和章魚,而是使用有用的開源工具RSBuild來部署報告。在octopus軟件包中捆綁rsbuild.exe可執行文件(很小)和一個deploy.config以及您的報告很容易。然後你可以使用章魚的替代功能來重寫配置文件和Powershell函數來執行可執行文件。這也有一個好處,就是你可以在沒有章魚的情況下輕鬆進行部署,數據源和報告的配置在XML中是聲明性的,而不是在Powershell中的過程化,而且腳本部署的智能可以與報告一起生活,而不是埋在八達通中。

所以我的配置看起來有點像:

<?xml version="1.0" encoding="utf-8" ?> 
<Settings> 
    <Globals> 
     <Global Name="CollapsedHeight">0.5in</Global> 
    </Globals> 
    <ReportServers> 
     <ReportServer Name="RS1" Protocol="http" Host="${ReportServer}" Path="${ReportServerPath}" Timeout="30" /> 
    </ReportServers> 
    <DataSources> 
     <DataSource Name="Source1" Publish="true" Overwrite="true" TargetFolder="Data Sources" ReportServer="RS1"> 
      <ConnectionString>data source=${ReportServer};initial catalog=${DatabaseName}</ConnectionString> 
      <CredentialRetrieval>Store</CredentialRetrieval> 
      <WindowsCredentials>False</WindowsCredentials> 
      <UserName>${RepotrUser}</UserName> 
      <Password>${ReportsPassword}</Password> 
     </DataSource> 
    </DataSources> 
    <Reports> 
     <ReportGroup Name="Details" DataSourceName="Source1" TargetFolder="Reports" 
      ReportServer="RS1" CacheTime="10080"> 
      <Report Name="BusinessReportABC"> 
       <FilePath>reports\BusinessReportABC.rdl</FilePath> 
      </Report> 
      <!--More reports here--> 
     </ReportGroup> 
    </Reports> 
</Settings> 

我的部署octopacked文物包含RSBuild.Core.dll,RSBuild.exe,deploy.config和報告文件

然後我只需調用使用powershell可執行文件:

PS> rsbuild deploy.config 
+0

感謝您的回答@alastairtree。這絕對是一個好方法。我實際上找到了上面我的問題的答案。正如上面提到的[這裏]使用了錯誤的ReportExecution Proxy Url(https://github.com/OctopusDeploy/Library/issues/261)。我猜想使用Octopus Step Template與使用RSBuild相似。 – LRBuffone

+0

嗨@alastairtree,我越來越_ [設置]:配置系統無法initialize_確實有這個問題,當使用RSBuild時,也似乎像一個死的項目... – Borik

+0

@borik不,我沒有。你是否檢查過你正在替換示例中的所有$ {XYZ}模板變量?也許只嘗試部署一個報告?它可能看起來像一個死了的項目,但對我來說它只是起作用,也許它不是「死」,更多「完成」。 – alastairtree