This is a migrated thread and some comments may be shown as answers.

Reporting Parameters Problem

1 Answer 87 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mike Booth
Top achievements
Rank 1
Mike Booth asked on 18 Feb 2011, 06:28 PM
I have a report parameter that is built off of a Role Table.  The Primary key of this table is RoleId(int).  The display value is RoleDisplay(varchar(50)).  It also contains ApplicationId which is a FK back to an Application table.
Example data would be as follows:
RoleId ApplicationId RoleDisplay
1 1 Administrator
2 2 Administrator
3 1 Viewer
4 1 Salesperson

This parameter is sourced from a Dataset that contains the Role Table.  The DisplayMember is set as RoleDisplay and the ValueMember is set as RoleId.  It is set as a MultiValue = True.

So, when I run the page this is on it loads all those roles into the parameter.  So, it displays:
Administrator
Administrator
Viewer
Salesperson

I then select all the roles.

In my code I am looping through the report parameter values and creating a string to send to a Stored Procedure.  When I loop through the values for the ReportParameter it returns 2,2,3,4.  It should return 1,2,3,4.  It is like it is really keying off of the display value.

I went in and changed the data in my table to:
RoleId ApplicationId RoleDisplay
1 1 Administrator
2 2 Administrator 2
3 1 Viewer
4 1 Salesperson

My code then returned the following role id's when all roles are selected.  1,2,3,4.

I am running Telerik Reporting Q3 2010 SP1 (4.2.10.1221)

I searched the forums and could not find this issue.

Thanks.

Private Function BuildParamList(ByVal paramType As String) As String
        Dim list As String = ""
        Dim count As Integer = 0
        For Each val As Integer In CType(Me.ReportParameters(paramType).Value(), Array)
            If count = 0 Then
                list = val.ToString
            Else
                list = list + "," + val.ToString()
            End If
            count = count + 1
        Next
 
        Return list
    End Function
 
    Private Sub AppDetailByRole_NeedDataSource(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.NeedDataSource
        'retrieve the data into the dataset
        Try
            Me.UsP_AppDetailByRoleContextTableAdapter1.Fill(Me.DataSet21.USP_AppDetailByRoleContext, _
                                                            BuildParamList("Application"), _
                                                            BuildParamList("Environment"), _
                                                            BuildParamList("Role"))
            TryCast(sender, Telerik.Reporting.Processing.Report).DataSource = Me.DataSet21.USP_AppDetailByRoleContext
        Catch ex As System.Exception
            'An error has occurred while filling the data set. Please check the exception for more information.
            System.Diagnostics.Debug.WriteLine(ex.Message)
        End Try
    End Sub



1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 24 Feb 2011, 01:32 PM
Hello Mike Booth,

We have reproduced the described behavior and it's related to the dropdownlist control used in the Web Report Viewer. Generally having duplicate Display Members may confuse the users because they will not know for which application is the chosen administrator. Thus our suggestion is to set the Display Member to the Role plus the Application (Application 1 Administrator). This way you will avoid the problematic behavior and the users will know which is the chosen administrator.

All the best,
Peter
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
General Discussions
Asked by
Mike Booth
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or