EssGBeginRemoveOnly

Description

EssGBeginRemoveOnly() begins a remove-only.

Syntax

ESSG_FUNC_M EssGBeginRemoveOnly (hGrid, usCells, pRemoveCells, ulOptions);
ESSG_HGRID_T hGrid
ESSG_USHORT_T usCells
ESSG_PRANGE_T pRemoveCells
ESSG_ULONG_T ulOptions

Parameters

hGridHandle passed back from EssGNewGrid.
usCellsA count of the number of cell ranges in pKeepCells (the size of array).
pRemoveCellsDescribes the cells to be removed. The members remove applys on a per dimension basis. That is, if the user decides to remove, for example, "Qtr1", then all other members of the Time dimension will be tossed and the only representitive of the Time dimension will be "Qtr1". All other dimensions in the report will be left untouched. This is a one-dimensional array of cell ranges.

More than one member from a dimension may be specified. Also, multiple dimensions may be specified.

ulOptionsReserved for future use. Should be set to zero.

Return Value

If successful, returns ESSG_STS_NOERR.

Notes

Example

ESSG_VOID_T ESSG_BeginRemoveOnly (ESSG_HGRID_T hGrid)

{
  ESSG_STS_T     sts = ESS_STS_NOERR;
  ESSG_PPDATA_T        ppDataIn;
  ESSG_PPDATA_T        ppDataOut;
  ESSG_RANGE_T          rDataRangeIn, rDataRangeOut;
  ESSG_ULONG_T          ulOptions;
  ESSG_USHORT_T        usCells;
  ESSG_RANGE_T          pRemoveCells;
  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)
  {
     ppDataIn = BuildTable(&rDataRangeIn); 
     
     pRemoveCells.ulRowStart = 1;
     pRemoveCells.ulColumnStart = 0;
     pRemoveCells.ulNumRows = 1;
     pRemoveCells.ulNumColumns = 1;
     ulOptions = 0;
     usCells = 1;
      
     /* start the remove-only operation */
     sts = EssGBeginRemoveOnly(hGrid, usCells,       
           &pRemoveCells, ulOptions);
  }

  if(sts == 0)
  {
     /* send the entire grid to define the query */
     sts = EssGSendRows(hGrid, &rDataRangeIn, 
           ppDataIn);
  }

  if(sts == 0)
  {
     /* perform the remove-only operation */
     sts = EssGPerformOperation(hGrid, 0);

     /* free the built data */
     FreeTwoDim(ppDataIn, rDataRangeIn.ulNumRows);
  }
  if (sts == 0)
  {
     /* determine the results of the remove-only 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
EssGGetCellLinkResults()
EssGBeginDrillAcross()
EssGBeginDeleteLROs()
EssGBeginDrillOrLink()
EssGFreeCellLinkResults()
EssGGetCellLinkResults()