我已经玩弄了几天而没有运气.基本上我正在尝试使用Powershell构建一个简单的库来呈现SSRS报告.我正在使用Powershell试图在以后简化开发(而不是为每个项目编写C#应用程序).大多数情况下,这将用于通过报告安排各种事情.
我有报告渲染主要在Powershell中工作.我无法弄清楚的一件事是如何在调用render方法之前为报表提供参数.我发现了大量与C#和VB相关的代码(我在其他SSRS项目中使用过),但是我无法将其转换为Powershell.
由于我对Powershell很新,我不熟悉正确的方法.这是我一直在使用的代码:
$ReportExecutionURI = "http://glitas10//ReportServer//ReportExecution2005.asmx?wsdl"
$ReportPath = "/Financial/ExpenseReportStub"
$format = "PDF"
$deviceInfo = "<DeviceInfo><NoHeader>True</NoHeader></DeviceInfo>"
$extension = ""
$mimeType = ""
$encoding = ""
$warnings = $null
$streamIDs = $null
$Reports = New-WebServiceProxy -Uri $ReportExecutionURI -UseDefaultCredential
# Load the report
$Report = $Reports.GetType().GetMethod("LoadReport").Invoke($Reports, @($ReportPath, $null))
# Render the report
$RenderOutput = $Reports.Render($format, $deviceInfo, [ref] $extension, [ref] $mimeType, [ref] $encoding, [ref] $warnings, [ref] $streamIDs)
Run Code Online (Sandbox Code Playgroud)
这显然适用于不需要参数的报表.
关于我需要做什么来实例化正确的对象和传递参数的任何想法?