GetTextCell

Returns the data in a cell in a String data type. GetTextCell also returns the cell’s status, and provides arguments to specify the returned data’s scale and decimal precision.

Tip:

To return a cell’s data as a Double data type, use GetCell instead of GetTextCell.

Syntax

<HsvData>.GetTextCell lScenario, lYear, lPeriod, lView, lEntity, lParent, lValue, lAccount, lICP, lCustom1, lCustom2, lCustom3, lCustom4, sNumDecimals, sScale, pbstrData, plStatus

Argument

Description

lScenario

Long (ByVal). The member ID of the cell's Scenario dimension member.

lYear

Long (ByVal). The member ID of the cell's Year dimension member.

lPeriod

Long (ByVal). The member ID of the cell's Period dimension member.

lView

Long (ByVal). The member ID of the cell's View dimension member.

lEntity

Long (ByVal). The member ID of the cell's Entity dimension member.

lParent

Long (ByVal). The member ID of the parent of the lEntity argument's entity.

lValue

Long (ByVal). The member ID of the cell's Value dimension member.

lAccount

Long (ByVal). The member ID of the cell's Account dimension member.

lICP

Long (ByVal). The member ID of the cell's Intercompany Partner dimension member.

lCustom1

Long (ByVal). The member ID of the cell's Custom 1 dimension member.

lCustom2

Long (ByVal). The member ID of the cell's Custom 2 dimension member.

lCustom3

Long (ByVal). The member ID of the cell's Custom 3 dimension member.

lCustom4

Long (ByVal). The member ID of the cell's Custom 4 dimension member.

sNumDecimals

Integer (ByVal). The number of decimal places that the pbstrData argument’s return value will contain.

To use the application’s default number of decimals, pass the HFMConstants type library constant DEFAULT_NUM_DECIMALS, described in Number Defaults Constants.

sScale

Integer (ByVal). The degree of scaling to be applied to the pbstrData argument’s return value. Rules for this argument are described below:

  • Pass 0 to return the number without scaling it.

  • Each integer greater than 0 scales the number by dividing it by 10. Pass 1 to divide the number by 10, 2 to divide the number by 100, and so on. For example, if you pass 3, and the cell contains 1,000,000.00, the pbstrData argument would return 1,000.00.

  • Similarly, each integer less than 0 scales the number by multiplying it by 10. Pass -1 to multiply the number by 10, 2 to multiply the number by 100, and so on. For example, if you pass -3, and the cell contains 1,000,000.00, the pbstrData argument would return 1,000,000,000.00.

  • To use the system’s default scaling, pass the HFMConstants type library constant DEFAULT_NUM_DECIMALS, described in Number Defaults Constants.

pbstrData

String. Returns the data in the cell.

plStatus

Long. Returns the cell’s status. For details on cell statuses, see About Cell Statuses.

Example

The following subroutine populates two Label controls with a cell’s data and status. The subroutine takes the member IDs of the cell’s dimension members. The cell status string is obtained by passing the status Long returned by GetTextCell to FormatStatusToText.

Sub fillCellLabels(lScen As Long, lYear As Long, lPer As Long, _
   lView As Long, lEnt As Long, lPar As Long, lVal As Long, _
   lAcct As Long, lICP As Long, lCust1 As Long, lCust2 As Long, _
   lCust3 As Long, lCust4 As Long)
Dim cData As HsvData, sData As String, lStatus As Long
Dim sStatus As String
'g_cSession is an HsvSession object reference
Set cData = g_cSession.Data
cData.GetTextCell lScen, lYear, lPer, lView, lEnt, lPar, _
    lVal, lAcct, lICP, lCust1, lCust2, lCust3, lCust4, _
    DEFAULT_NUM_DECIMALS, DEFAULT_SCALE, sData, lStatus
sStatus = cData.FormatStatusToText(lStatus)
'Populate the labels
lblData.Caption = sData
lblStatus.Caption = sStatus
End Sub