GetLineItemsAtIndex

Returns the data and descriptions for a cell’s line items, given the indexes that identify the cell. GetLineItemsAtIndex also returns the member IDs of the cell’s Account, Intercompany Partner, and Custom dimension member, and indicates whether the line items are saved as year-to-date or periodic.

Syntax

<HsvMDDataBuffer>.GetLineItemsAtIndex lCubeIndex, lPeriodIndex, lCellIndex, plAccount, plICP, plCustom1, plCustom2, plCustom3, plCustom4, pvbSavedAsYTD, pvaradData, pvarabstrDescriptions

Argument

Description

lCubeIndex

Long (ByVal). The index of the cell’s subcube. Use BeginEnumeration or GetCubeIndexFromPOV to determine valid index values.

lPeriodIndex

Long (ByVal). The index of the cell’s period. Use GetNumPeriodsInCubeForLineItems or GetPeriodIndexFromPOVForLineItems to determine valid index values.

lCellIndex

Long (ByVal). The index of the cell. Use GetNumCellsForLineItems to determine valid index values.

plAccount

Long. Returns the member ID of the cell’s Account dimension member.

plICP

Long. Returns the member ID of the cell’s Intercompany Partner dimension member.

plCustom1

Long. Returns the member ID of the cell’s Custom 1 dimension member.

plCustom2

Long. Returns the member ID of the cell’s Custom 2 dimension member.

plCustom3

Long. Returns the member ID of the cell’s Custom 3 dimension member.

plCustom4

Long. Returns the member ID of the cell’s Custom 4 dimension member.

pvbSavedAsYTD

Boolean. Indicates how the cell is saved. Returns TRUE if the cell is saved as year-to-date, FALSE if saved as periodic.

pvaradData

Variant array. Returns the data for the cell’s line items. The array is returned as a Double subtype.

pvarabstrDescriptions

Variant array. Returns the descriptions of the cell’s line items. The array is returned as a String subtype.

Example

The following example loops through the cells in an HsvMDDataBuffer object and prints each line item’s data and description to Visual Basic’s Immediate window. The example assumes that the object has previously been filled with data. BeginEnumeration locks the object and returns the number of subcubes in the object. The loops then work as follows:

EndEnumeration then unlocks the HsvMDDataBuffer object.

Dim lNumCubes As Long, lNumPers As Long, lNumCells As Long
Dim lAccount As Long, lIntCo As Long, lCus1 As Long
Dim lCus2 As Long, lCus3 As Long, lCus4 As Long
Dim bYTD As Boolean, vdMdData, vdMdDesc
m_cMDBuffer.BeginEnumeration lNumCubes
For i = 0 To lNumCubes - 1
  m_cMDBuffer.GetNumPeriodsInCubeForLineItems i, lNumPers
  For j = 0 To lNumPers - 1
    m_cMDBuffer.GetNumCellsForLineItems i, j, lNumCells
    For k = 0 To lNumCells - 1
      m_cMDBuffer.GetLineItemsAtIndex i, j, k, lAccount, _ 
      lIntCo, lCus1, lCus2, lCus3, lCus4, bYTD, _ 
      vdMdData, vdMdDesc
      For l = LBound(vdMdData) To UBound(vdMdData)
        Debug.Print vdMdData(l) & " " & vdMdDesc(l)
      Next l
    Next k
  Next j
Next i
m_cMDBuffer.EndEnumeration