Returns the member IDs of the members with descriptions in a given language that match a search string.
<IHsvTreeInfo>.FindMatchingMembersFromHierarchyByDesc bstrSearchText, lTopMemberID, varbExactMatch, lLanguageID, pvaravaralPaths
String (ByVal). The search string. Pass all or part of the descriptions for which the search is being conducted. If you pass a partial description, the method searches for all descriptions that begin with the passed string. | |
Long (ByVal). The member ID of the top member in the hierarchy from which to begin searching. To search the entire dimension hierarchy, use the HFMConstants type library constant TREE_ROOT. | |
Boolean (ByVal). Specifies whether to search for an exact or partial match. Pass TRUE for an exact match search, FALSE for a partial match search. | |
Long (ByVal). The ID of the language. You can get this ID with the EnumLanguages method of the HsvMetadata object. | |
Variant. Returns an array of arrays containing the member IDs of the matching members. Each array contains one item for each member in the path from the specified top member to the matching member. For example, suppose that a search returns two members: Canada (with no parent) and UnitedStates.California. The indexes to the array of arrays would be similar to those in the following list: |
The following subroutine prints to Visual Basic’s Immediate window the labels of all members of a given dimension with descriptions that partially match the specified string.
Sub printMatchingDescs(iDim As Integer, langId As Long, _ sSearch As String) Dim cTreeInfo As IHsvTreeInfo, vaMems, sLabel As String 'Set the IHsvTreeInfo interface to the specified dimension. 'g_cMetadata is an HsvMetadata object reference. Set cTreeInfo = g_cMetadata.Dimension(iDim) cTreeInfo.FindMatchingMembersFromHierarchyByDesc sSearch, TREE_ROOT, _ False, langId, vaMems 'Loop through the array of arrays For i = LBound(vaMems) To UBound(vaMems) 'Loop through the items in each array For j = LBound(vaMems(i)) To UBound(vaMems(i)) cTreeInfo.GetLabel vaMems(i)(j), sLabel Debug.Print sLabel Next j Debug.Print vbCrLf Next i End Sub