I have some VB.net code that retrieves all the report parameters for an SSRS report. According to the MSDN documentation the Visible and PromptUser properties should correlate to whether the report displays a prompt for that parameter (rather then just an error if not supplied). However in this sample code these properties always come back true. The code references the MS.ReportViewer.WebForms dll. I've tried version 10 and 11.
Public Function GetReportParameters(strPath As String) As List(Of Microsoft.Reporting.WebForms.ReportParameterInfo)
Dim lstParams As New List(Of Microsoft.Reporting.WebForms.ReportParameterInfo)
Dim objRV As New Microsoft.Reporting.WebForms.ReportViewer
objRV.ServerReport.ReportServerUrl = New System.Uri("http://localhost/ReportServer/")
objRV.ServerReport.ReportPath = strPath
Dim oRptParams As Microsoft.Reporting.WebForms.ReportParameterInfoCollection = objRV.ServerReport.GetParameters
For Each oRptParam As Microsoft.Reporting.WebForms.ReportParameterInfo In oRptParams
Dim strName As String = oRptParam.Name
Dim blnPromptUser As Boolean = oRptParam.PromptUser
Dim blnVisible As Boolean = oRptParam.Visible
lstParams.Add(oRptParam)
Next
Return lstParams
End Function
I have also tried this using LocalReport instead of ServerReport but it didn't help. As you can see from the report parameter properties in Report Builder there is a parameter set to hidden.