0
votes

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

1 Answers

0
votes

Did you get this to work? I have looked and looked at this - and the only things I see are that I don't see where your ReportPath is set - but I assume it is because you got data in execInfo... so the only other thing I see is that you don't have the ExecutionHeaderValue set...

so add this code and give it a try...

Dim execHeader as New ExecutionHeader()
rs.ExecutionHeaderValue = execHeader

make sure you put it before execInfo = .LoadReport(ReportPath, historyID)

I tried to convert my c# code to VB - so you may want to verify syntax!