GetDataAtIndex

Returns the data for a cell, given the indexes that identify the cell. GetDataAtIndex also indicates whether the cell is null, and returns the member IDs of the cell’s View, Account, Intercompany Partner, and Custom dimension members.

Syntax

<HsvMDDataBufferLite>.GetDataAtIndex lCubeIndex, lPeriodIndex, lCellIndex, plView, plAccount, plICP, plCustom1, plCustom2, plCustom3, plCustom4, pdData, pvbIsNoData

Argument

Description

lCubeIndex

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

lPeriodIndex

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

lCellIndex

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

plView

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

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.

pdData

Double. Returns the cell’s data.

pvbIsNoData

Boolean. Indicates whether the cell is null. Returns TRUE if null, FALSE otherwise.

Example

The following example loops through the cells in an HsvMDDataBufferLite object and prints each cell’s data 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 works as follows:

EndEnumeration then unlocks the HsvMDDataBufferLite object.

Dim lNumCubes As Long, lNumPers As Long, lNumCells As Long
Dim lVw As Long, lAccount As Long, lIntCo As Long
Dim lCus1 As Long, lCus2 As Long, lCus3 As Long, lCus4 As Long
Dim dMdData As Double, bMdNoData As Boolean
m_cMDBufferLite.BeginEnumeration lNumCubes
For i = 0 To lNumCubes - 1
  m_cMDBufferLite.GetNumPeriodsInCubeForData i, lNumPers
  For j = 0 To lNumPers - 1
    m_cMDBufferLite.GetNumCellsForData i, j, lNumCells
    For k = 0 To lNumCells - 1
      m_cMDBufferLite.GetDataAtIndex i, j, k, lVw, lAccount, _ 
      lIntCo, lCus1, lCus2, lCus3, lCus4, dMdData, bMdNoData
      Debug.Print dMdData
    Next k
  Next j
Next i
m_cMDBufferLite.EndEnumeration