# EssOtlOpenOutline

Description

EssOtlOpenOutline() opens and reads in an existing outline. This function (or EssOtlNewOutline()) must be called before any operations on the outline can take place.

Syntax

    ESS_FUNC_M EssOtlOpenOutline (hCtx, pObject, fLock, fKeepTrans, phOutline);

ESS_HCTX_T | hCtx
ESS_POBJDEF_T | pObject
ESS_BOOL_T | fLock
ESS_BOOL_T | fKeepTrans
ESS_PHOUTLINE_T | phOutline

Parameters

hCtx | Essbase Context handle.
pObject | Pointer to an object structure defining the outline object to open.
flock | Flag to determine if the outline should be locked when it is opened. This is valid only for server outlines.
fKeepTrans | Flag to determine whether to keep transactions. If you are opening an existing outline to make changes, and you intend to restructure the database and keep data, we recommend that you set this flag to ESS_TRUE. When ESS_TRUE, a log is kept of activities done to the outline. If you are starting from an empty outline or are not planning on saving data when you restructure, we recommend that you set this field to ESS_FALSE. When ESS_FALSE, no log is kept, saving time and memory.
phOutline | Pointer to an ESS_HOUTLINE_T variable. This handle is set by the API and should be passed to subsequent Outline API functions.

Return Value

Returns 0 if successful; otherwise one of the following:

OTLAPI_BAD_OBJTYPE
OTLAPI_ERR_FILEOPEN
OTLAPI_ERR_FILEIO

Notes

- If the outline file exists on the server, this call copies the file locally for client access.

Access

This function requires you to have the appropriate level of access to the specified application and/or database to contain the outline object. To lock the outline object (lock flag is ESS_TRUE), you must have Application Designer or Database Designer privilege (ESS_PRIV_APPDESIGN or ESS_PRIV_DBDESIGN) for the specified application or database containing the outline.

Example

    #include <essapi.h>
    #include <essotl.h>

    ESS_STS_T          sts = 0;
    ESS_OBJDEF_T       Object;
    ESS_HOUTLINE_T     hOutline;
    ESS_APPNAME_T      szAppName;
    ESS_DBNAME_T       szDbName;
    ESS_OBJNAME_T      szFileName;

    memset(&Object, '\0', sizeof(Object));
    Object.hCtx = hCtx;
    Object.ObjType = ESS_OBJTYPE_OUTLINE;
    strcpy(szAppName, "Sample");
    strcpy(szDbName, "Basic");
    strcpy(szFileName, "Basic");
    Object.AppName = szAppName;
    Object.DbName = szDbName;
    Object.FileName = szFileName;
    sts = EssOtlOpenOutline(hCtx, &Object, ESS_TRUE,
         ESS_TRUE, &hOutline);

See Also

EssOtlCloseOutline()
EssOtlGetMemberCommentEx()
EssOtlNewOutline()
EssOtlRestructure()
EssOtlSetMemberCommentEx()
EssOtlVerifyOutline()
EssOtlWriteOutline()