HypListDocuments

Cloud data provider types: Oracle Planning and Budgeting Cloud

On-premises data provider types: Oracle Hyperion Planning, Oracle Hyperion Financial Management

Description

HypListDocuments returns a list of folders and forms that are saved on the provider server, in the path specified by the user.

Note:

In descriptions for this function, folders and forms are referred to as documents.

Unlike other VBAs, this is not a sheet-specific function. Sheet information is optional for this function. Refer to Parameters.

Syntax

HypListDocuments (vtSheetName, vtUserName, vtPassword, vtConnInfo, vtCompletePath, vtDocs)

ByVal vtSheetName As Variant

ByVal vtUserName As Variant

ByVal vtPassword As Variant

ByVal vtConnInfo As Variant

ByVal vtCompletePath As Variant

ByRef vtDocs As DOC_Info

DOC_Info is in turn defined as the following type :

Type DOC_Info

     numDocs As Long

     docTypes As Variant

     docNames As Variant

     docDescriptions As Variant

     docPlanTypes As Variant

     docAttributes As Variant

End Type

See further descriptions below in Parameters.

Parameters

vtSheetName: Optional. The name of the worksheet which will be used to obtain connection information, if vtConnInfo is empty. If vtSheetName is also empty, the active data source will be used to obtain connection information.

vtUserName: Optional input parameter. Used to connect using the given connection info (vtConnInfo/vtSheetName). Not necessary to be given if user is sure that the connection already exists.

vtPassword: Optional input parameter. Used to connect using the given connection info (vtConnInfo/vtSheetName). Not required if user is sure that the connection already exists.

vtConnInfo: Optional input parameter. Connection information, given either in the form of a friendly private connection name, or in the format accepted by HypConnect() or HypUIConnect(). If vtConnInfo is empty, vtSheetName is used to obtain connection info. If both are empty, the active data source is used.

vtCompletePath: Mandatory input parameter. The folder path within the server for which the document list is needed.

vtDocs: Mandatory output parameter. The list of documents (files and folders) present inside the given vtCompletePath, returned from the VBA.

DOC_Info Structure Definitions

numDocs: Number of folders plus the number of forms in the given folder. Defines the length of each of the arrays noted below.

docTypes: An array of strings. Array defining the type of each of the documents. Two types are supported, "DOC_FORM" and "DOC_FOLDER". Two global constants define the two types, which can be used to compare these values with the ones in the array

Global Const HYP_LIST_DOC_FORM = "DOC_FORM"
Global Const HYP_LIST_DOC_FOLDER = "DOC_FOLDER"

See Example for usage.

docNames: An array of strings. Array containing names of each document, in the same order as above.

docDescriptions: An array of strings. Document descriptions, if any, in the same order as above. For folders, this field is empty.

docPlanTypes: An array of strings. Plantype information for each document, in the same order as above. For folders, this field is empty.

docAttributes: An array of strings. Attribute information for each document, in the same order as above. For folders, this field is empty. For forms, this field can be any of the following:

Enum FORM_ATTRIBUTES

     NO_ATTRIBUTE = -1 (for a folder)

     HFM_BASIC_FORM = 0

     ADHOC_ENABLED = 8 (basic form)

     COMPOSITE_FORM = 16

     SMART_FORM = 128

     SAVED_ADHOC_GRID = 40

     SAVED_ADHOC_EXCLUSIVE_GRID = 104

     SMART_FORM_ADHOC_ENABLED = 136

End Enum

HypListDocuments sends these values back as strings. See Example.

Note that a folder has only a name associated with it. Other information is only available for forms.

Return Value

Returns 0 if successful; otherwise, returns the appropriate error code.

Example

The following VBA can be used directly, using each of the invocations one by one.

Sub testListDocs()

Dim ret As Integer
Dim firstDocType
Dim vtDocs As DOC_Info
Dim vtAttr

'Usage with connection information as given for HypConnect()/HypUIConect()
ret = HypListDocuments("", "<user_name>", "<password>", "http://<server_url>:<port>/HyperionPlanning/SmartView|<server>|EPBCS|", "/<path>", vtDocs)

'Usage with friendly private connection name.
'ret = HypListDocuments("", "<user_name>", "<password>", "<server>", "/<path>", vtDocs)

'Usage with connection information present in Sheet1.
'ret = HypListDocuments("Sheet1", "<user_name>", "<password>", "", "/<path>", vtDocs)

'Usage with active data source
'ret = HypListDocuments("", "<user_name>", "<password>", "", "/<path>", vtDocs)

MsgBox "Total no. of docs is : " & vtDocs.numDocs

If vtDocs.numDocs > 0 Then
   'First, folder info is sent, and then forms info.
   firstDocType = vtDocs.docTypes(0)

   If vtDocs.docTypes(0) = HYP_LIST_DOC_FORM Then
      MsgBox "First doc is a form."
   Else
      MsgBox "First doc is a folder."
   End If

   MsgBox "First doc name is : " & vtDocs.docNames(0)

   MsgBox "First doc attribute is : " & vtDocs.docAttributes(0)

   'Need to convert attribute string to integer before comparison.
   vtAttr = CInt(vtDocs.docAttributes(0))

   If vtAttr <> NO_ATTRIBUTE Then

      If vtAttr = ADHOC_ENABLED Then
         MsgBox "This form is adhoc-enabled"
      End If

      If vtAttr = SAVED_ADHOC_GRID Then
         MsgBox "This is a saved ad-hoc grid"
      End If

      If vtAttr = SAVED_ADHOC_EXCLUSIVE_GRID Then
         MsgBox "This is a saved ad-hoc exclusive grid"
      End If

      If vtAttr = COMPOSITE_FORM Then
         MsgBox "This is a composite form."
      Else
         MsgBox "This is not a composite form."
      End If

   End If

End If
End Sub