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