GetReportData

Returns data for journals; only actual journal amounts are returned.

Note:

To return both scaled and actual amounts, use GetReportData2.

Syntax

<IHsvJournalsReport>.GetReportData lScenario, lYear, lPeriod, lValue, vararvFilters, varalColumns, varanSortFlags, pvar2DvarData, pvardValues, pvarlStatus

Argument

Description

lScenario

Long (ByVal). The member ID of the Scenario dimension member for the report data.

lYear

Long (ByVal). The member ID of the Year dimension member for the report data.

lPeriod

Long (ByVal). The member ID of the Period dimension member for the report data.

lValue

Long (ByVal). The member ID of the Value dimension member for the report data.

vararvFilters

Variant (ByVal). Filters out journals:

  • To return all journals in the report, pass an empty variable.

  • To filter out journals from the report, pass this as a Variant array that consists of 32 elements

When filtering journals, each array element corresponds to a type of filter. The available filters and their indexes in this 32-element array are described in Table 66, Journal Report Filter Array Elements. Specify values for only those elements that correspond to the desired filtering criteria; if you do not want to use a filter, leave the corresponding array element empty.

Note:

In this release only, elements 1-6 and elements 14-16 of this array are supported; the remaining elements are reserved for future use.

varalColumns

Long array (ByVal). Specifies the display columns that the report data will contain. To create this array, use the constants listed in Table 67, Report Column Display Constants.

Tip:

Specify the sortable columns as the top elements of this array, which has a one-to-one correspondence with the varanSortFlags argument’s array.

varanSortFlags

Integer array (ByVal). Specifies the columns on which the report data will be sorted, as well as the sort order. This array has a one-to-one correspondence with the varalColumns argument’s array. To specify these columns, use one of the HFMConstants type library constants listed in Journal Report Sort Option Constants.

pvar2DvarData

Variant array. Returns information for the specified columns. This is a multidimensional array, with one dimension for each column specified in the varalColumns argument; in each dimension, there is one element per journal.

For details on the values returned in the array elements, see Table 67, Report Column Display Constants.

pvardValues

Variant array. Returns the debit and credit amounts for the journals in the report. This array has a one-to-one correspondence with the pvar2DvarData argument’s array, and is returned as a Double subtype.

pvarlStatus

Variant array. Returns an array that indicates whether the connected user has access to the line items. Each array element returns one of the following values:

  • 0 if the user has access to the corresponding line item.

  • CELLSTATUS_NOREADACCESS, which is an HFMConstants type library constant indicating that the user does not have access to a cell.

This array has a one-to-one correspondence with the pvar2DvarData argument’s array, and is returned as a Long subtype.

Example

The following subroutine gets data of Approved and Posted journals that match the specified journal label and are for the specified dimension members. The journal labels and the labels of the journals’ Entity and Account dimension members are printed to Visual Basic’s Immediate window. The report information is sorted by the Label column in ascending order.

Sub printPostApprJnlRpt(lScen As Long, lYear As Long, lPer As Long, _
  lVal As Long, sJnlLbl As String)
Dim cJournalsReport As IHsvJournalsReport
Dim laCols(3) As Long, vaDisplayData, vaFilter(31)
Dim iaSortFlags(0) As Integer, vaVals, vaStatus
Dim cTreeInfo As IHsvTreeInfo, sMemberLabel As String
'g_cSession is an HsvSession object reference
Set cJournalsReport = g_cSession.Journals
'Specify the display columns.
laCols(0) = 0
laCols(1) = 14
laCols(2) = 15
laCols(3) = 16
'Specify the filtering criteria
vaFilter(0) = sJnlLbl
vaFilter(1) = Array(JSF_APPROVED, JSF_POSTED)
'Sort ascending on the Label column
iaSortFlags(0) = JOURNALREPORT_SORT_ASCENDING
'Print the report data for the specified journals.
cJournalsReport.GetReportData lScen, lYear, lPer, _
  lVal, vaFilter, laCols, iaSortFlags, vaDisplayData, _
  vaVals, vaStatus
For i = LBound(vaDisplayData, 1) To UBound(vaDisplayData, 1)
  Debug.Print "Label: " & vaDisplayData(i, 0)
  'g_cMetadata is an HsvMetadata object reference
  Set cTreeInfo = g_cMetadata.Entities
  cTreeInfo.GetLabel vaDisplayData(i, 1), sMemberLabel
  Debug.Print "Entity: " & sMemberLabel
  cTreeInfo.GetLabel vaDisplayData(i, 2), sMemberLabel
  Debug.Print "Parent: " & sMemberLabel
 Set cTreeInfo = g_cMetadata.Accounts
  cTreeInfo.GetLabel vaDisplayData(i, 3), sMemberLabel
  Debug.Print "Account: " & sMemberLabel & vbCrLf
Next i
End Sub