AddDataToMDDataBuffer

Adds an application’s cell to an HsvMDDataBuffer or HsvMDDataBufferLite object. Any data, description, or line items for the cell will be added.

Syntax

<HsvData>.AddDataToMDDataBuffer lScenario, lYear, lPeriod, lView, lEntity, lParent, lValue, lAccount, lICP, lCustom1, lCustom2, lCustom3, lCustom4, varbIncludeDerivedData, pIUnkDataBuffer

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.

varbIncludeDerivedData

Boolean (ByVal). Determines whether derived data is included. Pass TRUE to include derived data, FALSE otherwise.

pIUnkDataBuffer

HsvMDDataBuffer or HsvMDDataBufferLite object (ByVal). The object reference for the object to which the cell is being added.

Example

The following example adds cells to an HsvMDDataBuffer object. The member IDs for all dimension members other than the Account dimension are passed from another procedure. IHsvTreeInfo.EnumAllMemberIDs gets the member IDs of the application’s accounts, and the first For…Next loop uses HsvMetadata.IsCustomMemberValidForAccount to identify the accounts that have valid intersections for the Custom dimension members passed from the other procedure. Cells for the valid intersections are then added to an HsvMDDataBuffer object with AddDataToMDDataBuffer.

Dim cHsvMDBuffer As HsvMDDataBuffer, iMemsCount As Integer
Dim vaMemIDs, bCust1Valid As Boolean, bCust2Valid As Boolean
Dim bCust3Valid As Boolean, bCust4Valid As Boolean
Set cHsvMDBuffer = New HSVMDARRAYSLib.HsvMDDataBuffer
'Get the IDs of all the Account dimension members.
m_cIHsvTreeInfo.EnumAllMemberIDs vaMemIDs
'Add the cells for accounts that are valid for the
'custom dimensions to an HsvMDDataBuffer object.
For iMemsCount = LBound(vaMemIDs) To UBound(vaMemIDs)
  m_cHsvMetadata.IsCustomMemberValidForAccount 8, m_lCust1, _ 
  vaMemIDs(iMemsCount), bCust1Valid
  m_cHsvMetadata.IsCustomMemberValidForAccount 9, m_lCust2, _ 
  vaMemIDs(iMemsCount), bCust2Valid
  m_cHsvMetadata.IsCustomMemberValidForAccount 10, m_lCust3, _ 
  vaMemIDs(iMemsCount), bCust3Valid
  m_cHsvMetadata.IsCustomMemberValidForAccount 11, m_lCust4, _ 
  vaMemIDs(iMemsCount), bCust4Valid
  If bCust1Valid = True And bCust2Valid = True And _ 
  bCust3Valid = True And bCust4Valid = True Then
    m_cHsvData.AddDataToMDDataBuffer m_lScen, m_lYear, m_lPer, _ 
    m_lView, m_lEnt, m_lPar, m_lVal, _ 
    vaMemIDs(iMemsCount), m_lICP, m_lCust1, m_lCust2, _ 
    m_lCust3, m_lCust4, FALSE, cHsvMDBuffer
  End If
Next iMemsCount