# EsbReportFile

Description

EsbReportFile() sends a report specification to the active database from a file. The report data can either be output, or the report specification can just be verified and any errors returned. Also, the corresponding data blocks in the Database can optionally be locked by this call (lock for update).

Syntax

    EsbReportFile (hDestCtx, hSrcCtx, AppName, DbName, FileName, isOutput, isLock)

    ByVal hDestCtx As Long
    ByVal hSrcCtx  As Long
    ByVal AppName  As String
    ByVal DbName   As String
    ByVal FileName As String
    ByVal isOutput As Integer
    ByVal isLock   As Integer

Parameters

hDestCtx | Essbase VB API context handle of a target Database on the server.
hSrcCtx | Essbase VB API context handle for the report file location. The report file can reside on the client or on the same server as the target Database. If the report file is on the client (local), the local context must be created with EsbCreateLocalContext().
AppName | Application name for the report file location.
DbName | Database name for the report file location.
FileName | Name of the report specification file. It is not necessary to specify the file extension; the extension is understood to be `.rep`.
isOutput | Controls output of data. If TRUE, data is output from the server, according to the specified report. If FALSE, no data is output.
isLock | Controls block locking. If TRUE, all blocks which are accessed by the report specification are locked for update. If FALSE, no blocks are locked.

Return Value

None.

Notes

- If this function causes data to be output (Output flag is TRUE), the returned data can be read by calling EsbGetString().
- If this function causes blocks to be locked (Lock flag is TRUE), the caller is responsible for unlocking the locked blocks (e.g. by calling EsbUpdate() with the Unlock flag set to TRUE).
- If both the Output and Lock flags are set to FALSE, the database merely performs a syntax check of the report specification.

Access

This function requires the caller to have read privilege (ESB_PRIV_READ) to one or more members in the active database.

Example

    Declare Function EsbReportFile Lib "ESBAPIW" (ByVal hDestCtx As Long, ByVal hSrcCtx As Long, ByVal AppName As String, ByVal DbName As String, ByVal FileName As String, ByVal Output As Integer, ByVal Lock As Integer) As LongSub ESB_ReportFile ()
       Dim sts As Long
       Dim AppName As String
       Dim DbName As String
       Dim FileName As String
       Dim pOutput As Integer
       Dim pLock As Integer
       Dim hSrcCtx As Long Const szRString = 256
       Dim RString As String * szRString AppName = "Sample"
       DbName = "Basic"
       hSrcCtx = hCtx
       FileName = "test"
       pOutput = ESB_YES
       pLock = ESB_NO sts = EsbReportFile(hCtx, hSrcCtx, AppName,
       DbName, FileName, pOutput, pLock)
       If sts = 0 Then
          sts = EsbGetSTring(hCtx, RString, szRString)
       Do While Mid$(RString, 1, 1) <> Chr$(0)
          Print RString
          sts = EsbGetSTring(hCtx, RString, szRString)
         Loop
       End If
    End Sub

See Also

EsbBeginReport()
EsbGetString()
EsbReport()
EsbUpdateFile()