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

Pre filtering OLAP data

1 Answer 49 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 11 May 2015, 01:18 PM

Hi 

We have an OLAP cube we want to view with the PivotGrid in an ASP.NET website. 

We need to allow different users only to view their own data from the cube with some kind of pre-filter or sub query.  

Any help to achieve this would be appreciated.

Thanks in advance

Richard

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 14 May 2015, 07:01 AM
Hi,

Possible approach in your case is to apply initial filter by using the FilterByLabel and FilterByValue methods of the RadPivotGrid in the PreRender event.

For example:

FilterBylabel:

protected override void OnPreRender(EventArgs e)
{
    base.OnPreRender(e);
    RadPivotGrid1.FilterByLabel(PivotGridFilterFunction.Contains, RadPivotGrid1.Fields["Cost"], "filter value");
}

protected override void OnPreRender(EventArgs e)
{
    base.OnPreRender(e);
    RadPivotGrid1.FilterByLabel(PivotGridFilterFunction.IsNotBetween, RadPivotGrid1.Fields["Cost"], "filter value", "beetween filter value");
}

FilterByValue:

protected override void OnPreRender(EventArgs e)
{
    base.OnPreRender(e);
    RadPivotGrid1.FilterByValue(PivotGridFilterFunction.BeginsWith,
        RadPivotGrid1.Fields["Line"],
        RadPivotGrid1.Fields["Total"] as PivotGridAggregateField,
        "filter value");
}

protected override void OnPreRender(EventArgs e)
{
    base.OnPreRender(e);
    RadPivotGrid1.FilterByValue(PivotGridFilterFunction.IsBetween,
        RadPivotGrid1.Fields["Line"],
        RadPivotGrid1.Fields["Total"] as PivotGridAggregateField,
        "filter value",
        "between filter value");
}



Regards,
Maria Ilieva
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
PivotGrid
Asked by
Richard
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or