TranslateAttributeValueForDisplay

Returns a String representation of a dimension member’s attribute. However, in cases where the attribute value is itself a dimension member, the member ID of the attribute value is returned instead of the member’s label.

Syntax

<IHsvTreeInfo>.TranslateAttributeValueForDisplay sAttrib, vValue, bstrValue, plDimID

Argument

Description

sAttrib

Integer (ByVal). The ID of the attribute. These IDs are represented by the following groups of constants in the HFMConstants type library:

vValue

Variant (ByVal). The attribute value to be converted to a String representation.

For example, to get the String representation of an account type, you can pass the numeric value returned by HsvAccounts.GetAccountType.

bstrValue

String. Returns one of the following values:

  • If the attribute value is not a dimension member, this argument returns the String representation of the attribute value.

  • If the attribute value is a dimension member, this argument returns a blank string. In this case the member ID of the attribute value is returned in the plDimID argument.

    For example, a blank string would be returned if TranslateAttributeValueForDisplay is called to obtain an account’s Custom1TopMember attribute and the attribute value is a valid Custom 1 dimension member.

plDimID

Long. Returns one of the following values:

  • If the attribute value is not a dimension member, this argument returns -1.

  • If the attribute value is a dimension member, this argument returns the member ID. In this case you can get the member’s label with GetItemID.

Example

The following function takes an account name and returns the String representation of the account’s type.

Function getAccountTypeString(sLabel As String) As String
Dim cAccounts As HsvAccounts, cTreeInfo As IHsvTreeInfo
Dim lAcctId As Long, iType As Integer, sVal As String
Dim lRetId As Long
Set cAccounts = m_cMetadata.Accounts
Set cTreeInfo = m_cMetadata.Accounts
lAcctId = cTreeInfo.GetItemID(sLabel)
cAccounts.GetAccountType lAcctId, iType
cTreeInfo.TranslateAttributeValueForDisplay _ 
ATTRIB_ACCOUNT_TYPE, iType, sVal, lRetId
getAccountTypeString = sVal
End Function