Gets a string of data from the active database. This function should be called after EssReport() or EssEndReport() if data is returned.
Syntax
ESS_FUNC_M EssGetString (hCtx, pString);
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | API context handle. |
pString | ESS_PSTR_T | Address of pointer to receive allocated returned data string. |
Notes
Calling this function other than after successfully executing a report will generate an error.
The returned string will be less than 64 KB long.
Always include the carriage return/line feed with this command or errors will result.
You must call EssGetString() until it returns a NULL string.
The memory allocated for pString should be freed using EssFree().
Return Value
An allocated pointer to the data string is returned in pString. This pointer will be NULL if there is no more data to be returned.
Access
This function requires no special privileges.
Example
ESS_FUNC_M ESS_Report (ESS_HCTX_T hCtx, ESS_HINST_T hInst ) { ESS_FUNC_M sts = ESS_STS_NOERR; ESS_STR_T rString = NULL; sts = EssBeginReport (hCtx,ESS_TRUE,ESS_FALSE); if (!sts) sts = EssSendString (hCtx, "<Desc Year !"); if (!sts) sts = EssEndReport (hCtx); /************** * Get report * **************/ if (!sts) sts = EssGetString (hCtx, &rString); while ((!sts) && (rString != NULL)) { printf ("%s", rString); EssFree (hInst, rString); sts = EssGetString (hCtx, &rString); } printf ("\r\n"); return(sts); }
See Also