# EssLROUpdateObject

Description

EssLROUpdateObject() stores an updated version of a linked reporting object on the server.

Syntax

    ESS_FUNC_M EssLROUpdateObject (hCtx, plinkId, usOption, pLRODesc);

ESS_HCTX_T | hCtx
ESS_PLROHANDLE_API_T | plinkId
ESS_USHORT_T | usOption
ESS_PLRODESC_API_T | pLRODesc

Parameters

hCtx | Essbase API context handle.
plinkId | Pointer to object identification structure.
usOption | Option specifying whether to store the object, its catalog entry, or both. Use one of the following: ESS_LRO_OBJ_API stores only the object. ESS_LRO_CATALOG_API stores only the catalog entry. ESS_LRO_BOTH_API stores the object and the catalog entry.
pLRODesc | Pointer to object's description structure, ESS_LRODESC_API_T.

Return Value

If successful, returns ESS_STS_NOERR. Otherwise, returns an error code.

Notes

- The linked object can be any of the following types:
  - A flat file, such as a Word document, Excel spreadsheet, or bitmap image.
  - A cell note containing up to 599 characters of text.
  - A link to another Essbase database (Linked Partitions feature).
- Cell notes are part of the catalog entry for an object. To store a cell note, use ESS_LRO_CATALOG_API for the usOption parameter. The linked note is contained in structure ESS_LRODESC_API_T.
- The name of the last user to modify the object and the modification date are also updated.

Access

A call to this function requires write privileges (ESS_PRIV_WRITE) to the active database.

Example

    ESS_STS_T ESS_LRO UpdateObject (ESS_HCTX_T hCtx)
    {
    	ESS_STS_T 		sts = ESS_STS_NOERR;
    	ESS_LROHANDLE_API_T	linkId;
    	ESS_LRODESC_API_T	lroDesc;
    	ESS_USHORT_T		usOption = 2;   /* Default is catalog */

    	memset (&linkId, 0, sizeof(ESS_LROHANDLE_API_T));
    	memset (&lroDesc, 0, sizeof(ESS_LRODESC_API_T));

    	linkId.hObject = 25;
    	linkId.cellKey.cellOffset = 149;
    	linkId.cellKey.blkOffset = 113.0;
    	linkId.cellKey.segment = 0.0;

    	/* Linked object is a LRO. (Windows Application) */
    	lroDesc.usObjType = 1;

    	/* Update both object and catalog */
       	usOption = ESS_LRO_BOTH_API;
    	strcpy (lroDesc.lro.lroInfo.objName, "e:\\lro\\lroex.c");
    	strcpy (lroDesc.lro.lroInfo.objDesc, "My C file");

    	strcpy (lroDesc.userName, "user1");
    	lroDesc.linkId.hObject = linkId.hObject;

    	sts = EssLROUpdateObject(hCtx, &linkId, usOption, &lroDesc);
    	if (sts)
    	{
    		printf("Could not update linked object.\n");
    	}
    	return sts;
    }

See Also

LRO Constant and Structure Definitions
EssLROGetObject()
EssLROAddObject()
EssLRODeleteObject()