GetCellLineItems

Returns arrays of the data and descriptions for the specified cell’s line items. Data is returned in a Double array.

Tip:

To return data in a String array, use GetTextCellLineItems.

Syntax

<HsvData>.GetCellLineItems lScenario, lYear, lPeriod, lEntity, lAccount, lICP, lCustom1, lCustom2, lCustom3, lCustom4, pvardData, pvarbstrDetails

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.

lEntity

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

lAccount

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

Tip:

Use HsvAccounts.UsesLineItems to check whether an account supports line items.

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.

pvardData

Variant. Returns an array of Doubles that contain the line item data.

pvarbstrDetails

Variant. Returns an array of Strings that contain the line item descriptions.

Example

This example prints a cell’s line item descriptions and data to Visual Basic’s Immediate window. The example assumes the variables passed to GetCellLineItems have been set to the cell’s member IDs, and uses UsesLineItems to test whether the cell’s Account dimension member supports line items. If line items are supported, the cell’s descriptions and data are printed.

Dim bLineItems As Boolean, cAccounts As HsvAccounts
Dim vaData, vaDescs, cData As HsvData
'g_cSession is an HsvSession object reference
Set cData = g_cSession.Data
'g_cMetadata is an HsvMetadata object reference
Set cAccounts = g_cMetadata.Accounts
'Exit if the account does not support line items
cAccounts.UsesLineItems lAcct, bLineItems
If bLineItems = False Then Exit Sub
cData.GetCellLineItems lScen, lYear, lPer, lEnt, lAcct, _
    lIcp, lCust1, lCust2, lCust3, lCust4, vaData, vaDescs
' Make sure the cell is not empty
If IsArray(vaData) = True Then
    For i = LBound(vaData) To UBound(vaData)
        Debug.Print vaDescs(i) & ": " & vaData(i) & vbCrLf
    Next i
End If