dbTalk Databases Forums  

Re: ADOMD.Net Bug ?

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Re: ADOMD.Net Bug ? in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mary Potapova [MS]
 
Posts: n/a

Default Re: ADOMD.Net Bug ? - 05-15-2006 , 07:51 PM






hello Reno,

Hierarchies collection would contain all hierarchies - user hierarchies as
well as attribute hierarchies. If you want to list only user hierarchies,
check the property hierarchy.HierarchyOrigin which should allow you to
distinguish those.

hope this helps,
- mary
--
This posting is provided "AS IS" with no warranties, and confers no rights.
--
"Renaud Harduin" <rh (AT) nospam (DOT) fr> wrote

Quote:
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







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.