Ejemplo n.º 1
0
        /// <summary>
        /// Gets the comment for a specified cell of the cube.
        /// </summary>
        /// <param name="firstElement">The first element name.</param>
        /// <param name="secondElement">The second element name.</param>
        /// <param name="elements">A variable list of additional dimension elements that reference the cell.</param>
        /// <returns>A string representing the cell comment. If the cell did not exist the return value is null.</returns>
        public string GetCellComment(string firstElement, string secondElement, params string[] elements)
        {
            if (Dimensions == null)
            {
                return(null);
            }
            System.Collections.Specialized.StringCollection elementNames = new System.Collections.Specialized.StringCollection();
            elementNames.Add(firstElement);
            elementNames.Add(secondElement);
            if (elements != null)
            {
                for (int i = 0; i < elements.Length; i++)
                {
                    elementNames.Add(elements[i]);
                }
            }
            if (_dimensions.Count != elementNames.Count)
            {
                throw new System.ArgumentException(CreateExceptionString(_elementMismatch));
            }
            string result = NativeOlapApi.CubeGetCellComment(_server.Store.ClientSlot, _serverHandle, _name, elementNames, _server.LastErrorInternal);

            elementNames = null;
            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the comment for a specified cell of the cube.
        /// </summary>
        /// <param name="elements">A list of dimension elements that reference the cell.</param>
        /// <returns>A string with the cell comment. If the cell comment did not exist the return value is null.</returns>
        public string GetCellComment(System.Collections.Specialized.StringCollection elements)
        {
            if (Dimensions == null)
            {
                return(null);
            }

            if (_dimensions.Count != elements.Count)
            {
                throw new System.ArgumentException(CreateExceptionString(_elementMismatch));
            }
            string result = NativeOlapApi.CubeGetCellComment(_server.Store.ClientSlot, _serverHandle, _name, elements, _server.LastErrorInternal);

            if (result == null)
            {
                result = string.Empty;
            }
            return(result);
        }