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.
<HsvMDDataBuffer>.GetLineItemsAtIndex lCubeIndex, lPeriodIndex, lCellIndex, plAccount, plICP, plCustom1, plCustom2, plCustom3, plCustom4, pvbSavedAsYTD, pvaradData, pvarabstrDescriptions
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:
For each subcube, GetNumPeriodsInCubeForLineItems gets the number of periods with cells that contain line items.
For each period in a subcube, GetNumCellsForLineItems gets the number of cells that contain line items.
For each cell that contains line items, GetLineItemsAtIndex gets the line items’ data and descriptions, which are then printed to the Immediate window.
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