Extracting Journals with Filters

To extract journals by applying filters, set extract options with the ExtractOptionsEx property, then call ExtractEx method as described in the following steps.

Note:

For an example that illustrates these steps, see Example for Filtered Journal Extractions.

  To extract journals by applying filtering criteria:

  1. Set an object reference to the HsvJournalLoadACV object.

  2. Point to the application from which journals are being extracted by calling HsvJournalLoadACV.SetSession. For SetSession’s argument, pass the HsvSession object reference that was returned by HsxClient.OpenApplication or HsxClientUI.OpenApplication.

  3. Set an object reference to the IHsvLoadExtractOptions interface with the HsvJournalLoadACV.ExtractOptionsEx property.

  4. Specify the Scenario and Year dimension members for which journals are to be extracted. To specify these members, use the Scenario and Year extract options.

  5. Specify the journal type filter by using the Type journal extract option.

    Tip:

    For details on journal extract options, see Table 83, Journal Extract Options (Filtered).

  6. Optional. To override the defaults for other extract options, specify the values for these options. If you do not override any defaults, journals will be extracted, standard and recurring templates will not be extracted, and no filtering criteria will be applied.

    Note:

    The extraction uses only those filtering criteria for which you have set the corresponding extract option. For example, to avoid filtering by label and group, do not set the Label and Group extract options.

  7. Extract the journals by calling HsvJournalLoadACV.ExtractEx. ExtractEx takes the file names and paths of the journal extract file and of the log file.

Example for Filtered Journal Extractions

The following example extracts journals for the Actual scenario in the year 2000 that have a Regular journal type and a status of Submitted or Posted.

Note:

The example uses a user-defined function named GetMemberID to obtain the IDs of these members. For information on this user-defined function, see the Examples for GetItemID.

Dim cJournalLoadACV As HsvJournalLoadACV
Dim cOptions As IHsvLoadExtractOptions
Dim cOpt As IHsvLoadExtractOption, lScen As Long
Dim lYear As Long, laTypes(0) As Long, laStatus(1) As Long
Set cJournalLoadACV = New HsvJournalLoadACV
'Specify the HsvSession object for the application.
cJournalLoadACV.SetSession g_cHsvSession
'Initialize the IHsvLoadExtractOptions interface.
Set cOptions = cJournalLoadACV.ExtractOptionsEx
'Set the scenario to "Actual"
Set cOpt = cOptions.Item(HSV_JOURNALEXTRACT_EX_OPT_SCENARIO)
lScen = GetMemberID(DIMENSIONSCENARIO, "Actual")
cOpt.CurrentValue = lScen
'Set the year to "2000"
Set cOpt = cOptions.Item(HSV_JOURNALEXTRACT_EX_OPT_YEAR)
lYear = GetMemberID(DIMENSIONYEAR, "2000")
cOpt.CurrentValue = lYear
'Set the Type to Regular
Set cOpt = cOptions.Item(HSV_JOURNALEXTRACT_EX_OPT_FILTER_TYPE)
laTypes(0) = JTF_REGULAR
cOpt.CurrentValue = laTypes
'Extract only Submitted and Posted journals
Set cOpt = _
   cOptions.Item(HSV_JOURNALEXTRACT_EX_OPT_FILTER_STATUS)
laStatus(0) = JSF_SUBMITTED
laStatus(1) = JSF_POSTED
cOpt.CurrentValue = laStatus
'Extract the Journals
cJournalLoadACV.ExtractEx "c:\Acme\Jnl.jlf", "c:\Acme\Jnl.log"