![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Hi, I'm currently doing some test on ADOMD.Net. I'm using the SSAS Lesson 7 Tutorial Cube for the following code. I'm loading the dim/hierarchy tree into a Treeview (winform). I wrote a Facade tu surface eaysily ADOMD.net methods and load data into a TreeNode : private void getHierarchyTree(ref TreeNode r_parentNode, string cubeName, string DimName) { Dictionary<string, string> hier = this.getHierarchies( cubeName, DimName); string hierName; foreach (string hierKey in hier.Keys) { hierName = hier[hierKey]; TreeNode hier_node = new TreeNode(hierName); /* populates the levels for that given hierarchy */ this.getLevelTree(ref hier_node, cubeName, DimName, hierKey); hier_node = null; r_parentNode.Nodes.Add(hier_node); } } it calls this sub method : public Dictionary<string, string> getHierarchies(string cubeName, string dimKey ) { Dictionary<string, string> dict = new Dictionary<string, string>(); Dimension dim = this._mdConn.Cubes[ cubeName].Dimensions[ dimKey]; //foreach (Hierarchy hier in dim.Hierarchies) //{ // dict.Add(hier.UniqueName, hier.Caption); //} int cnt = dim.Hierarchies.Count; for (int i = 0; i < cnt; i++) { dict.Add(dim.Hierarchies[i].UniqueName, dim.Hierarchies[i].Caption); } return dict; } My concern : The cube "Analysis Services Tutorial" has a dimension called "Date" wich contains only 2 hierarchies : - Calendar Time - Fiscal Time but ... when I run that code on the hierarchy "Date" it finds more than those 2 hierarchies. It finds all the hierarchies contained into the (related) Time Dimension (attributes + real hierarchies = 10 Hierarchies). How to get only the 2 used hierarchies, or how to filter those wich are used and those wich are not (I'm using the Microsoft.AnalysisServices.AdomdClient ns) rgds, Reno |
![]() |
| Thread Tools | |
| Display Modes | |
| |