Articles in this section
Category / Section

How to get the filtered name in Silverlight OLAP Client?

1 min read

You can get the filtered members unique name in column and row of OLAP Client using the following code example.


public OlapManager()
            string connectionString = "Data Source=; Initial Catalog=Adventure Works DW 2008 SE;";
            _dataManager = new OlapDataProvider(connectionString);
            _dataManager.BeforeMdxQueryExecute += new Syncfusion.Olap.Manager.QueryExecuteEventHandler(_dataManager_BeforeMdxQueryExecute);
        void _dataManager_BeforeMdxQueryExecute(object sender, Syncfusion.Olap.Manager.QueryExecutingEventArgs e)
            Syncfusion.Olap.Reports.Items categoricalItems = e.Report.CategoricalElements;
            foreach (Syncfusion.Olap.Reports.Item categoricalItem in categoricalItems)
                if (categoricalItem.ElementValue is Syncfusion.Olap.Reports.DimensionElement && categoricalItem.ExcludedElementValue != null)
                   Syncfusion.Olap.Reports.DimensionElement dimensionElem = categoricalItem.ExcludedElementValue as Syncfusion.Olap.Reports.DimensionElement;
                    //Dimension UniqueName
                    string filtrDimeUniqueName = dimensionElem.UniqueName;
                    Syncfusion.Olap.Reports.HierarchyElement hierElem = dimensionElem.Hierarchy;
                    //Hierarchy UniqueName
                    string filtrHierUniqueName = hierElem.UniqueName;
                    List<string> filtrLevUniqueNames = new List<string>();
                    List<string> memElemtUniqueNames = new List<string>();
                    foreach (LevelElement levElmt in hierElem.LevelElements)
                        //Level UniqueName
                        foreach (MemberElement memElmt in levElmt.MemberElements)
                            //Filtered Member UniqueName


Private Function OlapManager() As Public
        Dim connectionString As String = "Data Source=; Initial Catalog=Adventure Works DW 2008 SE;"
        _dataManager = New OlapDataProvider(connectionString)
        _dataManager.BeforeMdxQueryExecute += New Syncfusion.Olap.Manager.QueryExecuteEventHandler(_dataManager_BeforeMdxQueryExecute)
End Function
    Private Sub _dataManager_BeforeMdxQueryExecute(ByVal sender As Object, ByVal e As Syncfusion.Olap.Manager.QueryExecutingEventArgs)
        Dim categoricalItems As Syncfusion.Olap.Reports.Items = e.Report.CategoricalElements
        Dim categoricalItem As Syncfusion.Olap.Reports.Item
        For Each categoricalItem In categoricalItems
            If Not TypeOf categoricalItem.ElementValue Is Syncfusion.Olap.Reports.DimensionElement And categoricalItem.ExcludedElementValue Is Nothing Then
Dim dimensionElem As Syncfusion.Olap.Reports.DimensionElement =  categoricalItem.ExcludedElementValue as Syncfusion.Olap.Reports.DimensionElement 
    'Dimension UniqueName
    Dim filtrDimeUniqueName As String = dimensionElem.UniqueName
    Dim hierElem As Syncfusion.Olap.Reports.HierarchyElement = dimensionElem.Hierarchy
    'Hierarchy UniqueName
    Dim filtrHierUniqueName As String = hierElem.UniqueName
                    Dim filtrLevUniqueNames As List<string> =  New List<string>() 
                    Dim memElemtUniqueNames As List<string> =  New List<string>() 
    Dim levElmt As LevelElement
                    For Each levElmt In hierElem.LevelElements
    'Level UniqueName
    Dim memElmt As MemberElement
                        For Each memElmt In levElmt.MemberElements
    'Filtered Member UniqueName
    End Sub


Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment