EssGBeginReportFile

Description

EssGBeginReportFile() runs a report file at the server.

Syntax

ESSG_FUNC_M EssGBeginReportFile (hGrid, pszReportName, bLocal, ulOptions);
ESSG_HGRID_T hGrid
ESSG_STR_T pszReportName
ESSG_BOOL_T bLocal
ESSG_ULONG_T ulOptions

Parameters

hGridHandle passed back from EssGNewGrid.
pszReportNameName of report to run. If this report resides on the server, then it should exist in the APPLICATION\DATABASE directory. If this report resides locally, then this string contains the absolute path name of the report.
bLocalBoolean indicating whether the report exists locally or not. A TRUE value indicates the report exists locally while a FALSE value indicates the report exists on the server.
ulOptionsA bitmask which describes returned grid options. Valid values are: ESSG_NOATTRIBUTES returns grid without pAttributes values

Return Value

If successful, returns ESSG_STS_NOERR.

Notes

Access

None.

Example

ESSG_VOID_T ESSG_BeginReportFile (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            pszReportName;
  ESSG_BOOL_T           bLocal;
  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)
  {
     pszReportName = "DescYear";
     bLocal = ESSG_FALSE;            
     ulOptions = ESSG_NOATTRIBUTES;
     
     /*start the report file operation */
     sts = EssGBeginReportFile(hGrid,          
           pszReportName,bLocal, ulOptions);
  }

  if(sts == 0)
  {
     /* perform the report operation */
     sts = EssGPerformOperation(hGrid, 0);
  }

  if (sts == 0)
  {
     /* determine the results of the report operation */
     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

Using the Grid API Functions
Grid API Structures