Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSRS 2005 ServerReport.GetParameters() not returning values

Status
Not open for further replies.

B827

Technical User
Feb 14, 2002
281
GB
Experts,
I am just starting with SSRS and am encountering a problem which is causing me some grief. I want to be able to pass the logon id as a parameter to reports. I want to hide this for obvious reasons. Iam using the following code in an attempt to pick up the manually input parameter values so I can pass all of them to the report.

Dim paramlist As New Generic.List(Of Microsoft.Reporting.WebForms.ReportParameter)
Dim params As ReportParameterInfoCollection = ReportViewer1.ServerReport.GetParameters()
Dim paramcount As Integer = ReportViewer1.ServerReport.GetParameters.Count
Dim gVal As String, gName As String
i = 0
For i = 0 To paramcount - 1
'------------------
'-------------------------
gName = params(i).Name
gVal = params(i).Values(0)
If gVal = "UserID" Then
paramlist.Add(New Microsoft.Reporting.WebForms.ReportParameter(gName, UserID, False))
paramlist.Add(New Microsoft.Reporting.WebForms.ReportParameter("Test", 0, False))
Else
'paramlist.Add(New Microsoft.Reporting.WebForms.ReportParameter(gName, gVal, False))
'Dim gTxt As String = params(gVal).Values(0).ToString
End If
Next


Unfortunately the GetParameters does not pick up any values. Can some kind soul point out my error.

Many thanks

Sandy.

Sandy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top