I'm developing an SSIS 2012 package which uses a Script task to load and render an SSRS 2012 report from an SSRS server via a web service using SOAP. My problem lies in the code that sets the parameter values. When the code below runs, I get the following SOAP error message when it tries to execute the rs.SetExecutionParameters method:
Microsoft.ReportingServices.Diagnostics.Utilities.UnknownReportParameterException: An attempt was made to set a report parameter 'prmDomainID' that is not defined in this report.
Yet if I open the report in Design mode, the parameter is clearly there. And checking the execInfo variable at run-time, also shows the parameter is there. I've tried deleting the report on the server and redeploying it but that didn't work. I've tried changing the parameter name to include the leading "@" symbol but that didn't work either. I've made sure the parameter data type (integer) matches the type of value I'm passing in. I've been googling for hours and nothing seems to make it recognize the parameters I'm passing in. (Note the prmDomainID parameter is set to Visible. Not sure if that matters.)
What am I missing here?
Dim rs As New ReportExecutionService
Dim format As String = "HTML4.0"
Dim mimeType As String = Nothing
Dim historyID As String = Nothing
Dim deviceInfo As String = Nothing
Dim extension As String = Nothing
Dim encoding As String = Nothing
Dim warnings() As Warning = Nothing
Dim streamIDs() As String = Nothing
Dim results() As Byte
Dim execInfo As New ExecutionInfo
Dim parameters(1) As ParameterValue
parameters(0) = New ParameterValue()
parameters(0).Name = "prmDomainID"
parameters(0).Value = "15"
With rs
.Credentials = System.Net.CredentialCache.DefaultCredentials
execInfo = .LoadReport(ReportPath, historyID)
.SetExecutionParameters(parameters, "en-us")
results = .Render(format, deviceInfo, extension, mimeType, encoding, warnings, streamIDs)
End With
Return System.Text.Encoding.Default.GetString(results)