Hi All,
We are trying to implement dynamic dimension security using a Custom procedure written in C#.
If we create a single entry in the return set everything works fine (See Below)
Microsoft.AnalysisServices.AdomdServer.Expression Expression = new Microsoft.AnalysisServices.AdomdServer.Expression();
Expression.ExpressionText = "[Sub Branch Id].[All Branch].[4]";
Microsoft.AnalysisServices.AdomdServer.Member Member = Expression.CalculateMdxObject(null).ToMember();
TupleBuilder.Add(Member);
SetBuilder.Add(TupleBuilder.ToTuple());
However when we try and add a second item to the Tuple builder the object returns the error : The 'Sub Branch Id' Hierarchy appears more than once in the tuple.
Code snippet :
{
Microsoft.AnalysisServices.AdomdServer.Expression Expression = new Microsoft.AnalysisServices.AdomdServer.Expression();
Expression.ExpressionText = "[Sub Branch Id].[All Branch].[2]";
Microsoft.AnalysisServices.AdomdServer.Member Member = Expression.CalculateMdxObject(null).ToMember();
TupleBuilder.Add(Member);
Expression=null;
Member=null;
}
{
Microsoft.AnalysisServices.AdomdServer.Expression Expression = new Microsoft.AnalysisServices.AdomdServer.Expression();
Expression.ExpressionText = "[Sub Branch Id].[All Branch].[3]";
Microsoft.AnalysisServices.AdomdServer.Member Member = Expression.CalculateMdxObject(null).ToMember();
TupleBuilder.Add(Member);
Expression=null;
Member=null;
}
SetBuilder.Add(TupleBuilder.ToTuple());
Please can some one help resolve this issue as its becoming critical for the project that we are currently working on, otherwise we will have to revisit the security model.
TIA
Hello,
most likely you don't create a new tuple for each new member. Create a new instance of TupleBuilder to resolve it.
Radim
|||
Thanks for the Help Radmin, It was that.
The source example we're using was from Teo Lacevs book, applied MS Analysis Services 2005. On Teo's Forum we have found the correct syntax (though not in C#), and it does work.
This is the link to the solution, http://prologika.com/CS/forums/thread/1861.aspx
No comments:
Post a Comment