EssReportFile

Description

EssReportFile() sends a report specification to the active database from a file. The report data can either be output, or the report specification can just be verified and any errors returned. Also, the corresponding data blocks in the database can optionally be locked by this call (lock for update).

Syntax

ESS_FUNC_M  EssReportFile (hDestCtx, hSrcCtx, AppName, DbName, FileName, Output, Lock); 
ESS_HCTX_ThDestCtx
ESS_HCTX_ThSrcCtx
ESS_STR_TAppName
ESS_STR_TDbName
ESS_STR_TFileName
ESS_BOOL_TOutput
ESS_BOOL_TLock

Parameters

hDestCtxEssbase API context handle of target database on the server.
hSrcCtxEssbase API context handle for report file location. The report file can reside on the client or on the same server as the target database. If the report file is on the client (local), the local context must be created with EssCreateLocalContext().
AppNameApplication name for report file location.
DbNameDatabase name for report file location.
FileNameName of report specification file. It is not necessary to specify the file extension; the extension is understood to be .rep.
OutputControls output of data. If TRUE, data is output from the server, according to the specified report. If FALSE, no data is output.
LockControls block locking. If TRUE, all blocks which are accessed by the report specification are locked for update. If FALSE, no blocks are locked.

Return Value

None.

Notes

Access

This function requires the caller to have read privilege (ESS_PRIV_READ) to one or more members in the active database.

Example

ESS_FUNC_M
ESS_ReportFile (ESS_HCTX_T  hCtx,
                ESS_HINST_T hInst
            )
{
   ESS_FUNC_M    sts = ESS_STS_NOERR;
   ESS_HCTX_T   hSrcCtx;
   ESS_STR_T    rString;
   ESS_STR_T    AppName;
   ESS_STR_T    DbName;
   ESS_STR_T    FileName;
      
   hSrcCtx = hCtx;
   AppName = "Sample";
   DbName  = "Basic";
   FileName = "Test";
      
   sts = EssReportFile (hCtx, hSrcCtx, AppName,
         DbName, FileName, ESS_TRUE, ESS_FALSE);
   /* Get the report */
   if (!sts)
      sts = EssGetString (hCtx, &rString);
   while ((!sts) && (rString != NULL))
   {
      printf ("%s", rString);
      EssFree (hInst, rString);
      sts = EssGetString (hCtx,&rString);
   }
   return(sts);
}

See Also

EssBeginReport()
EssGetString()
EssReport()
EssUpdateFile()