EssGBeginZoomIn

Description

EssGBeginZoomIn() begins a zoom-in.

Syntax

ESSG_FUNC_M EssGBeginZoomIn (hGrid, usCells, pZoomCells, ulOptions);
ESSG_HGRID_T hGrid
ESSG_USHORT_T usCells
ESSG_PRANGE_T pZoomCells
ESSG_ULONG_T ulOptions

Parameters

hGridHandle passed back from EssGNewGrid.
usCellsA count of the number of cell ranges in pZoomCells (the size of array).
pZoomCellsDescribes the cells to be zoomed in upon. This is a one-dimensional array of cell ranges.
ulOptionsA bitmask which describes the type of zoom-in (across or down) and the level of the zoom. The following two values are mutually exclusive:
  • ESSG_ZOOM_DOWN   Any page/title dimensions selected will be zoomed down
  • ESSG_ZOOM_ACROSS   Any page dimensions selected will be zoomed across

The following level values are to be or-ed in to ulOptions and are themselves mutually exclusive:

  • ESSG_NEXTLEVEL   Children
  • ESSG_ALLLEVELS   All members
  • ESSG_BOTTOMLEVEL   Bottom level
  • ESSG_SIBLEVEL   Sibling level
  • ESSG_SAMELEVEL   Same level
  • ESSG_SAMEGENERATION   Same generation
  • ESSG_CALCLEVEL   Calculation
  • ESSG_OPTIONS   Use setting for grid options

Return Value

If successful, returns ESSG_STS_NOERR.

Notes

Access

None.

Example

ESSG_VOID_T ESSG_BeginZoomIn (ESSG_HGRID_T hGrid)
{
  ESSG_FUNC_M    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         pZoomCells;
  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); 
     
     ulOptions = ESSG_ZOOM_DOWN | ESSG_ALLLEVELS;
     
     pZoomCells.ulRowStart = 0;
     pZoomCells.ulColumnStart = 2;
     pZoomCells.ulNumRows = 1;
     pZoomCells.ulNumColumns = 1;
     usCells = 1;
     
     /* start the zoom in operation */
     sts = EssGBeginZoomIn(hGrid, usCells, &pZoomCells, ulOptions);
  }

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

  if(sts == 0)
  {
     /* perform the zoom-in */
     sts = EssGPerformOperation(hGrid, 0);

     /* Free the built data */
     FreeTwoDim(ppDataIn, rDataRangeIn.ulNumRows);
  }

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