hi,
I have a pivotgrid connected to an OLAP cube.
I have placed on the columns fields the Year field and I wish to filter this field on a specific year in Code-behind in C #
I browsed the online documentation and the forum but I have not found the proper use for the methods FilterByLabel, FilterByValue, SetFilterIncludes.
I think that the examples provided are suitable for connections to relational databases but not multidimensional.
Could someone tell me how I can implement that kind of filter.
thank you in advance
best regards
I have a pivotgrid connected to an OLAP cube.
I have placed on the columns fields the Year field and I wish to filter this field on a specific year in Code-behind in C #
I browsed the online documentation and the forum but I have not found the proper use for the methods FilterByLabel, FilterByValue, SetFilterIncludes.
I think that the examples provided are suitable for connections to relational databases but not multidimensional.
Could someone tell me how I can implement that kind of filter.
thank you in advance
best regards
5 Answers, 1 is accepted
0
Hi,
In the help article below is described how to use the filtering methods.
In your case you could use the FilterByLabel or SetFilterIncludes method as shown below to filter the data.
Regards,
Antonio Stoilkov
Telerik
In the help article below is described how to use the filtering methods.
In your case you could use the FilterByLabel or SetFilterIncludes method as shown below to filter the data.
this
.RadPivotGrid1.FilterByLabel(PivotGridFilterFunction.Equals, RadPivotGrid1.Fields[
"Year"
],
"FY 2006"
);
this
.RadPivotGrid1.SetFilterIncludes(
"Year"
,
new
List<
object
>() { 2006 });
this
.RadPivotGrid1.SetFilterIncludes(
"Year"
,
new
List<
string
>() {
"2006"
});
Regards,
Antonio Stoilkov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Jérome
Top achievements
Rank 1
answered on 19 Dec 2014, 09:55 AM
Hi Antonio
first, thanks for your answer.
i have already tested the 3 methods you mentioned and it didn't work because my pivotgrid is connected to a OLAP cube and the filter has to be done on a member value, not on a label nor a value.
the screenshot attached to this post shows the filter set manually by manipulating the pivotgrid.
and I would like to be able to do the same programatically server-side.
Is there a way?
thanks
Regards
first, thanks for your answer.
i have already tested the 3 methods you mentioned and it didn't work because my pivotgrid is connected to a OLAP cube and the filter has to be done on a member value, not on a label nor a value.
the screenshot attached to this post shows the filter set manually by manipulating the pivotgrid.
and I would like to be able to do the same programatically server-side.
Is there a way?
thanks
Regards
0
Accepted
Hello Jérome,
The approach that Antonio have suggested with the RadPivotGrid1.SetFilterIncludes should get you the desired result, but I have tested it locally for the Year and I have noticed that for some reason it does not apply the provided year to the Include collection:
If you apply the same to a String field you can see that it is working correctly.
I will forward this to our developers, so they could further investigate what could cause the issue with the Year field.
Please excuse us for any inconvenience caused by this.
Regards,
Konstantin Dikov
Telerik
The approach that Antonio have suggested with the RadPivotGrid1.SetFilterIncludes should get you the desired result, but I have tested it locally for the Year and I have noticed that for some reason it does not apply the provided year to the Include collection:
protected
override
void
OnPreRender(EventArgs e)
{
base
.OnPreRender(e);
this
.RadPivotGrid1.SetFilterIncludes(
"FiscalYear"
,
new
List<
object
>() { 2009 });
}
If you apply the same to a String field you can see that it is working correctly.
I will forward this to our developers, so they could further investigate what could cause the issue with the Year field.
Please excuse us for any inconvenience caused by this.
Regards,
Konstantin Dikov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Greg
Top achievements
Rank 1
answered on 29 Mar 2016, 03:49 PM
I know this is a year and a half old thread, but is there a resolution to this? I can successfully set filter includes on string and integer fields but when I try on a PivotGridColumnField defined with GroupInterval="Year", the RadPivotGrid acts as if none of the includes are selected.
0
Jérome
Top achievements
Rank 1
answered on 30 Mar 2016, 12:00 PM
Hi Greg,
SetFilterIncludes works
as I used a connection to an OLAP cube, the items in the list had to be to the right format
in my exemple : this.RadPivotGrid1.SetFilterIncludes("Year", new List<object>() { [Annees].&[2006] });
Regards