Extracts data into a text file. The file will be created on the application server.
You can extract files onto client PCs with the HsvcDataLoad type library. This library also offers properties and methods that simplify handling of the data extract options. For more information, see Extracting Data. |
<HsvData>.Extract bstrServerFileName, bstrLogFileName, varavSettings
String (ByVal). The name and path of the data extract file. The path must exist on the application server. | |
String (ByVal). The name and path of the log file. The path must exist on the application server. | |
Variant array (ByVal). The extract options for the data extraction operation. The array is 1-based and contains 20 items. For details on valid indexes and values, see Table 60. Use EnumExtractOptions to return information about the valid extract options. In this array you must specify member IDs for the Scenario, Year, Period, Entity, and Account extract options — these options are set in array items 7 through 12. You can use the defaults returned by EnumExtractOptions for the other options. |
The following table describes the data extract options. Some of the valid values are represented by constants of the HsvcDataLoad type library. To use these constants, you must reference HsvcDataLoad in your project; for information on this library, see HsvcDataLoad Type Library.
The listed indexes apply to the array passed to Extract and to the first dimension of the array returned by EnumExtractOptions.
Table 60. Data Extract Options
The following example extracts data for the dimension members listed below:
The custom function getDataExtractDefaults assigns the default extract options to the vaSettings array. The IDs of the dimension members listed above are obtained with the custom function GetMemberID, then assigned to the vaSettings array; this overrides the previously assigned default values for vaSettings items 7 through 12. vaSettings is then passed to Extract.
For details on the getDataExtractDefaults custom function, see the Example for EnumExtractOptions. For details on the GetMemberID custom function, see the Examples for IHsvTreeInfo.GetItemID. |
Dim vaSettings, lScen As Long, lYear As Long, laPer(2) As Long
Dim laAcct(0) As Long, laPar(0) As Long, laEnt(0) As Long
'Get the default extract options
vaSettings = getDataExtractDefaults()
'Set the scenario and year
vaSettings(7) = GetMemberID(DIMENSIONSCENARIO, "Actual")
vaSettings(8) = GetMemberID(DIMENSIONYEAR, "2000")
'Set the periods
laPer(0) = GetMemberID(DIMENSIONPERIOD, "July")
laPer(1) = GetMemberID(DIMENSIONPERIOD, "August")
laPer(2) = GetMemberID(DIMENSIONPERIOD, "September")
vaSettings(9) = laPer
'Set the child and parent entities
laEnt(0) = GetMemberID(DIMENSIONENTITY, "Connecticut")
vaSettings(10) = laEnt
laPar(0) = GetMemberID(DIMENSIONENTITY, "UnitedStates")
vaSettings(11) = laPar
'Set the account
laAcct(0) = GetMemberID(DIMENSIONACCOUNT, "Sales")
vaSettings(12) = laAcct
'Extract the data
m_cHsvData.Extract "c:\Acme\myAppExt.dat", _
"c:\Acme\myAppExt.log", vaSettings