Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
50
Extending Infragistics.Olap.Data.Xmla.SqlAnalysisServices2008.Member
posted

Hi,

In the context of this post, I'm trying to extend Infragistics.Olap.Data.Xmla.SqlAnalysisServices2008.Member class to add some metadata that I will need to navigate to other datasource.

Based on this post from Atanas Dyulgerov about creating a custom provider, the override method for LoadMembersAsync(ICube cube, IFilterMember filterMember) has the following implementation:

        public override void LoadMembersAsync(ICube cube, IFilterMember filterMember)

        {

            AdomdProviderClient client = AdomdClientHelper.GetAdomdProviderClient(GetApplicationHostUri());

            client.LoadFilterMemberMembersCompleted += (s, args) =>

            {

                if (args.Error == null && !args.Cancelled)

                {

                    Member prentMember = filterMember.Member as Member;

                    ClearMemberChildren(prentMember);

                    foreach (AdomdMember member in args.Result)

                    {

                        DimensionMember currentMember =

                        new DimensionMember(

                            member.Name,

                            member.UniqueName,

                            member.Caption,

                            member.ParentUniqueName,

                            member.LevelUniqueName,

                            (int)member.LevelNumber,

                            filterMember.Member.ParentLevel.ParentHierarchy.Levels[(int)member.LevelNumber],

                            (int)member.ChildrenCardinality,

                            false,

                            false,

                            false);

                        currentMember.DrilldownMetadata = member.DrilldownMetadata;

                        AddMember(prentMember, currentMember);

                    }

                }

                this.OnLoadMembersCompleted(new AsyncCompletedEventArgs(args.Error, args.Cancelled, filterMember));

            };

            client.LoadFilterMemberMembersAsync(this.ConnectionString, cube.Name, filterMember.Member.UniqueName, filterMember.Member.ParentLevel.Depth + 1);           

        }

In this code, the DimensionMember class inherits from Infragistics.Olap.Data.Xmla.SqlAnalysisServices2008.Member, adding the metadata property (xml data).

This works fine for rendering the level members, but when I try to access the members of the generated tuples, I can not obtain a valid DimensionMember instance (for example, in the CellClicked Event).

As suggested in the post above, the corresponding tuple is obtained through the following code:

int rowIndex = myPivot.DataRows.IndexOf(cell.DataRow);

ITuple rowTuple = myPivot.DataSource.Result.RowAxis.Tuples[rowIndex];

But the following line returns a Infragistics.Olap.Data.Xmla.SqlAnalysisServices2008.Member instance (which implements IMember interface), and I can not cast it to a DimensionMember instance (returns null), maybe because the members are not created with the same references returned by the custom provider:

var dimensionMember = rowTuple.Members[0];

So, my question is if it is possible to add this custom metadata in the custom provider, and access it through the result tuples?

Thanks in advance.

Rui.