# EssBeginReport

Description

EssBeginReport() starts sending a report specification to the active database. This call must be followed by successive calls to EssSendString() to send the report specification, and finally by a call to EssEndReport(). 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

    ESS_FUNC_M EssBeginReport (hCtx, Output, Lock);

ESS_HCTX_T | hCtx
ESS_BOOL_T | Output
ESS_BOOL_T | Lock

Parameters

hCtx | Essbase API context handle.
Output | Controls output of data. If TRUE, data is output from the server, according to the specified report. If FALSE, no data is output.
Lock | 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

- This function must be followed by at least one call to EssSendString(), followed by a call to EssEndReport().
- If this function causes data to be output (Output flag is TRUE), the returned data can be read by calling EssGetString().
- 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 EssUpdate() 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 (ESS_PRIV_READ) to one or more members in the active database.

Example

    ESS_FUNC_M
    ESS_Report (ESS_HCTX_T   hCtx,
                ESS_HINST_T  hInst
               )
    {
       ESS_FUNC_M       sts     = ESS_STS_NOERR;
       ESS_STR_T     rString = NULL;
       sts = EssBeginReport (hCtx,ESS_TRUE,ESS_FALSE);
       if (!sts)
          sts = EssSendString (hCtx, "<Desc Year !");
       if (!sts)
          sts = EssEndReport (hCtx);
       /**************
        * Get report *
        **************/

       if (!sts)
          sts = EssGetString (hCtx, &rString);
       while ((!sts) && (rString != NULL))
       {
              printf ("%s", rString);
              EssFree (hInst, rString);
              sts = EssGetString (hCtx, &rString);
       }
       printf ("\r\n");

       return(sts);
    }

See Also

EssBeginUpdate()
EssEndReport()
EssGetString()
EssReport
EssReportFile()
EssSendString()