# EsbReport

Description

EsbReport() sends a report specification to the active database as a single string. This function is equivalent to making a call to EsbBeginReport(), followed by calls to EsbSendString() and finally EsbEndReport(). 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

    EsbReport (hCtx, isOutput, isLock, rptQuery)

    ByVal hCtx     As Long
    ByVal isOutput As Integer
    ByVal isLock   As Integer
    ByVal rptQuery As String

Parameters

hCtx | Essbase VB API context handle.
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.
rptQuery | The report specification, as a single string (must be less than 64 KBytes).

Return Value

None.

Notes

- The report specification string must be less than 64 KBytes long.
- If this function causes data to be output (Output flag is TRUE), the returned data can be read by calling EsbGetString() until an empty string is returned.
- 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. Any members that the caller does not have access to will be returned as missing.

Example

    Declare Function EsbReport Lib "ESBAPIW" (ByVal hCtx As Long, ByVal Output As Integer, ByVal Lock As Integer, ByVal Query As String) As Long

    Sub ESB_Report ()
       Dim sts As Long
       Dim pOutput As Integer
       Dim pLock As Integer
       Dim Query As String
       Const szRString = 256
       Dim RString As String * szRString

       Query = "<Desc Year !"
       pOutput = ESB_YES
       pLock = ESB_NO
       '***********
       ' Run Report
       '***********
       sts = EsbReport (hCtx, pOutput, pLock, Query)

       '**********************
       ' Print out all strings
       '**********************
       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()
EsbEndReport()
EsbGetString()
EsbReportFile()
EsbUpdate()
EsbSendString()