EssGBeginReport

Runs a report script at the server.

Syntax

 ESSG_FUNC_M EssGBeginReport (hGrid, pszReportIn, ulOptions) 
ParameterData TypeDescription

hGrid

ESSG_HGRID_T

Handle passed back from EssGNewGrid.

pszReportIn

ESSG_STR_T

String (no greater than 64K) containing an Essbase report specification.

ulOptions

ESSG_ULONG_T

A bitmask which describes returned grid options. Valid values are: ESSG_NOATTRIBUTES returns grid without pAttributes values.

Notes

Return Value

If successful, returns ESSG_STS_NOERR.

Access

None.

Example

 ESSG_VOID_T ESSG_BeginReport (ESSG_HGRID_T hGrid)
  
{
   ESSG_FUNC_M    sts = ESS_STS_NOERR;
   ESSG_PPDATA_T        ppDataOut;
   ESSG_RANGE_T         rDataRangeOut;
   ESSG_ULONG_T         ulOptions;
   ESSG_STR_T           pszReportIn;
   ESSG_USHORT_T        usState;
 
   /* connect the grid to a database on the server */
   sts = EssGConnect(hGrid, "Rainbow", "Admin", "Password", "Demo", "Basic",
          ESSG_CONNECT_DEFAULT);
       if(sts == 0)
   {      pszReportIn = "{TabDelim}<idesc Year !";
      ulOptions = ESSG_NOATTRIBUTES;
          sts = EssGBeginReport(hGrid, pszReportIn,
                   ulOptions);
   }
    if(sts == 0)
   {
      /* perform the report */
      sts = EssGPerformOperation(hGrid, 0);
   }
    if(sts == 0)
   {
      /* determine the results of the report */
      sts = EssGGetResults(hGrid, 0, &rDataRangeOut,
             &usState);
   }
       if(sts ==0)
   {
      /* get all the data */
      sts = EssGGetRows(hGrid, 0, &rDataRangeOut,
             &rDataRangeOut, &ppDataOut);
   }
       if(sts == 0)
   {
      DisplayOutput (ppDataOut, rDataRangeOut);
      /* Free the returned data */
      EssGFreeRows(hGrid, &rDataRangeOut, ppDataOut);
   }
        if(!sts)
   {
      EssGEndOperation(hGrid, 0);
      EssGDisconnect(hGrid, 0);
   }
 } 

See Also