Returns the member IDs of the members with labels or descriptions that match a search string; the search string can include wildcard characters. Description searches are for descriptions in a given language.
<IHsvTreeInfo>.FindMatchingMembersFromHierarchyWildCard bstrSearchText, lTopMemberID, lLanguageID, pvaravaralPaths
String (ByVal). String (ByVal). The search string. You can use asterisks ( * ) as wildcard characters. The following list describes the rules for wildcard searching: | |
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. | |
Long (ByVal). Specifies whether to search labels or descriptions. For description searches, this argument also specifies the language of the descriptions to be searched. Pass one of the following values:
| |
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 labels that match the specified string.
Sub printWildMatchingLabels(iDim As Integer, 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.FindMatchingMembersFromHierarchyWildCard sSearch, TREE_ROOT, _ HFM_NO_LANGUAGE, 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