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