# EssGCell

Description

EssGCell() retrieves from the server a singular value representing a solitary datapoint.

Syntax

    ESSG_FUNC_M EssGCell (hGrid, usCount, pszMbrs, pDataCell);

ESSG_HGRID_T | hGrid
ESSG_USHORT_T | usCount
ESSG_PSTR_T | pszMbrs
ESSG_PDATA_T | pDataCell

Parameters

hGrid | Handle passed back from EssGNewGrid.
usCount | Number of members being sent in. The maximum number of dimensions that EssGCell can report is 20.
pszMbrs | Array of member names to query. No more than one representative per dimension is allowed.
pDataCell | Value returned by server.

Return Value

If successful, returns ESSG_STS_NOERR.

Notes

- Retrieves from the server a singular value representing a solitary datapoint.
- You can specify a maximum of:
  - 20 members.
  - One member per dimension.
- If you do not specify a member for a dimension, the top level (dimension) member is used as the default.

Access

None.

Example

    ESSG_VOID_T ESSG_Cell (ESSG_HGRID_T hGrid)

    {
      ESSG_FUNC_M    sts = ESS_STS_NOERR;
      ESSG_USHORT_T        usCount;
      ESSG_DATA_T          DataCell;
      ESSG_CHAR_T          *pszMbrs[5] = { "Actual", "Jan",
                                         "West", "Audio",
                                         "Sales"};

      /* connect the grid to a database on the server */
      sts = EssGConnect(hGrid, "Rainbow", "Admin",
                        "Password", "Demo", "Basic",
                        ESSG_CONNECT_NODIALOG);

      /* retrieve cell value */
      usCount = 5;
      if(sts == 0)
         sts = EssGCell(hGrid, usCount, pszMbrs,&DataCell);

      if(!sts)
      {
         switch(DataCell.usType)
         {
           case(ESSG_DT_STRING):
            printf("%s", DataCell.Value.pszStr+1);
            break;
           case(ESSG_DT_LONG):
            printf("%ld", DataCell.Value.lData);
            break;
           case(ESSG_DT_DOUBLE):
            printf("%g", DataCell.Value.dblData);
            break;
           case(ESSG_DT_BLANK):
            break;
           case(ESSG_DT_RESERVED):
            printf("#Reserved");
            break;
           case(ESSG_DT_ERROR):
            printf("#Error");
            break;
           case(ESSG_DT_MISSING):
            printf("#Missing");
            break;
           case(ESSG_DT_ZERO):
            printf("%ld", DataCell.Value.lData);
            break;
           case(ESSG_DT_NOACCESS):
            printf("#NoAccess");
            break;
           case(ESSG_DT_MEMBER):
            printf("%s", DataCell.Value.pszStr+1);
            break;
           default:
            break;
         }
      }
      if(!sts)
         EssGDisconnect(hGrid, 0);
    }

See Also

Using the Grid API Functions
Grid API Structures