Exemplo n.º 1
0
        /// <summary>
        /// Increment a cell value of the cube.
        /// </summary>
        /// <param name="value">The cell value, which might be of type int, double or string. In any case,
        /// the type must be the same as the actual cell type.</param>
        /// <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>True, if the value has been set or false, otherwise.</returns>
        public bool IncrementCell(object value, string firstElement, string secondElement, params string[] elements)
        {
            if (Dimensions == null)
            {
                return(false);
            }

            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));
            }
            bool result = NativeOlapApi.CubePutCell(_server.Store.ClientSlot, _serverHandle, _name, elementNames, value, true, _server.LastErrorInternal);

            elementNames = null;
            return(result);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Increment a cell value of the cube.
 /// </summary>
 /// <param name="value">The cell value, which might be of type int, double or string. In any case,
 /// the type must be the same as the actual cell type.</param>
 /// <param name="elements">A variable list of additional dimension elements that reference the cell.</param>
 /// <returns>True, if the value has been set or false, otherwise.</returns>
 public bool IncrementCell(object value, System.Collections.Specialized.StringCollection elements)
 {
     if (Dimensions == null)
     {
         return(false);
     }
     if (_dimensions.Count != elements.Count)
     {
         throw new System.ArgumentException(CreateExceptionString(_elementMismatch));
     }
     return(NativeOlapApi.CubePutCell(_server.Store.ClientSlot, _serverHandle, _name, elements, value, true, _server.LastErrorInternal));
 }