Exemplo n.º 1
0
        public virtual void Draw(MdxDrawContext dc)
        {
            dc.Append(Name);

            if (_children)
            {
                dc.Append(".children");
            }

            if (_currentMember)
            {
                dc.Append(".CurrentMember");
            }

            if (_prevMember)
            {
                dc.Append(".PrevMember");
            }

            if (KeyProperties)
            {
                dc.Append(".Properties(\"Key\")");
            }

            if (_members)
            {
                dc.Append(".Members");
            }

            for (var i = 0; i < _parent; i++)
            {
                dc.Append(".Parent");
            }
        }
Exemplo n.º 2
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("NONEMPTY ");
            dc.OpenBracket("(");

            int i = 0;

            foreach (var mdxBuilder in _mdxBuilders)
            {
                mdxBuilder.Draw(dc);
                dc.Append(i < _mdxBuilders.Count - 1 ? "," : "");

                i++;
            }

            if (_mdxMeasures != null)
            {
                dc.Append(", ");
                dc.OpenBracket();

                i = 0;
                foreach (var mdxMeasure in _mdxMeasures)
                {
                    mdxMeasure.Draw(dc);
                    dc.Append(i < _mdxMeasures.Count - 1 ? "," : "");
                    dc.EndOfLine();

                    i++;
                }

                dc.CloseBracket();
            }

            dc.CloseBracket(")");
        }
Exemplo n.º 3
0
        public override void Draw(MdxDrawContext dc)
        {
            base.Draw(dc);

            if (Value == "Unknown")
            {
                dc.Append(".[All].UNKNOWNMEMBER");
            }
            else if (Value != null)
            {
                dc.Append(".&[");
                dc.Append(Value);
                dc.Append("]");
            }

            if (_secondValue != null)
            {
                if (_secondValue == "Unknown")
                {
                    dc.Append(".[All].UNKNOWNMEMBER");
                }
                else
                {
                    dc.Append("&[");
                    dc.Append(_secondValue);
                    dc.Append("]");
                }
            }

            if (_lagValue != null)
            {
                dc.Append(string.Format(".Lag({0})", _lagValue));
            }
        }
Exemplo n.º 4
0
        public void Draw(MdxDrawContext dc)
        {
            if (IsEmpty())
            {
                return;
            }

            if (_rows.Count > 1)
            {
                var unionMdxBuilder = new TypedMdxElement(_rows.ToArray());

                _rows = new List <IMdxElement>();
                _rows.Add(unionMdxBuilder);
            }

            int i = 0;

            foreach (var column in _rows)
            {
                dc.BeginLine();

                column.Draw(dc);
                dc.Append(i < _rows.Count - 1 ? "," : "");

                dc.EndOfLine();
                i++;
            }

            dc.AppendLine("ON ROWS");
        }
Exemplo n.º 5
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("Sum (");
            dc.EndOfLine();
            dc.IncLevel();
            dc.BeginLine();

            _mdxElement.Draw(dc);

            dc.Append(string.Format(".Lag({0}) :", _offset - 1));

            dc.EndOfLine();
            dc.BeginLine();

            _mdxElement.Draw(dc);

            dc.Append(".Lag(0),");

            dc.EndOfLine();
            dc.BeginLine();

            _measure.Draw(dc);

            dc.EndOfLine();
            dc.CloseBracket(")");
            dc.Append("/");
            dc.Append(_offset.ToString());
        }
Exemplo n.º 6
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("Round (");

            _numeratorMeasure.Draw(dc);

            dc.Append(string.Format(", {0})", _digitsCount));
        }
Exemplo n.º 7
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("Divide (");

            _numeratorMeasure.Draw(dc);

            dc.Append(string.Format(", {0}, 0)", _number));
        }
Exemplo n.º 8
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("IsEmpty(");

            _mdxValueExpression.Draw(dc);

            dc.Append(")");
        }
Exemplo n.º 9
0
        public void Draw(MdxDrawContext dc)
        {
            _firstMeasure.Draw(dc);

            dc.Append(" * ");

            _secondMeasure.Draw(dc);
        }
Exemplo n.º 10
0
        private void DrowMeasure(MdxDrawContext dc)
        {
            if (_minus)
            {
                dc.Append("-");
            }

            dc.Append("[Measures].[");
            dc.Append(Measure);
            dc.Append("]");
        }
Exemplo n.º 11
0
        public void Draw(MdxDrawContext dc)
        {
            if (Where == null || !Where.Measures.Any())
            {
                return;
            }

            dc.AppendLine("WHERE");

            Where.Draw(dc);
        }
Exemplo n.º 12
0
 public void Draw(MdxDrawContext dc)
 {
     if (_mdxBuilders != null)
     {
         foreach (var item in _mdxBuilders)
         {
             item.Draw(dc);
             dc.Append(" ");
         }
     }
 }
Exemplo n.º 13
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("Generate (");

            _mdxRangeElement.Draw(dc);

            dc.Append(", ");

            _measure.Draw(dc);

            dc.Append(")");
        }
Exemplo n.º 14
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("Sum (");

            _mdxElement.Draw(dc);

            dc.Append(", ");

            _measure.Draw(dc);

            dc.Append(")");
        }
Exemplo n.º 15
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("PeriodsToDate (");

            _mdxElement.Draw(dc);

            dc.Append(", ");

            _measure.Draw(dc);

            dc.Append(")");
        }
Exemplo n.º 16
0
        public void Draw(MdxDrawContext dc)
        {
            var i = 0;

            foreach (var mdxBuilder in _mdxBuilders)
            {
                mdxBuilder.Draw(dc);
                dc.Append(i < _mdxBuilders.Count - 1 ? "," : "");

                i++;
            }
        }
Exemplo n.º 17
0
        public void Draw(MdxDrawContext dc)
        {
            for (var i = 0; i < _elements.Count(); i++)
            {
                _elements[i].Draw(dc);

                if (i != _elements.Count() - 1)
                {
                    dc.Append(" * ");
                }
            }
        }
Exemplo n.º 18
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("Filter (");

            _mdxSetExpression.Draw(dc);

            dc.Append(", ");

            _mdxLogicalExpression.Draw(dc);

            dc.Append(")");
        }
Exemplo n.º 19
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("Divide (");

            _numeratorMeasure.Draw(dc);

            dc.Append(", ");

            _denominatorMeasure.Draw(dc);

            dc.Append(", ");
            dc.Append(_defaultResult + ")");
        }
Exemplo n.º 20
0
        public void Draw(MdxDrawContext dc)
        {
            for (var i = 0; i < _measures.Length; i++)
            {
                dc.Append("[Measures].[");
                dc.Append(_measures[i]);
                dc.Append("]");

                if (i < (_measures.Length - 1))
                {
                    dc.Append(" + ");
                }
            }
        }
Exemplo n.º 21
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("Order (");

            _mdxRowsElement.Draw(dc);

            dc.Append(", ");

            _measureOrDimension.Draw(dc);

            dc.Append(",");
            dc.Append(_dir);
            dc.Append(")");
        }
Exemplo n.º 22
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("SubSet");
            dc.OpenBracket("(");

            _mdxElement.Draw(dc);
            dc.Append(", ");
            dc.Append(_start.ToString());

            dc.Append(", ");
            dc.Append(_count.ToString());

            dc.CloseBracket(")");
        }
Exemplo n.º 23
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("SET [");
            dc.Append(_name);
            dc.Append("] AS");

            dc.EndOfLine();
            dc.IncLevel();

            dc.BeginLine();
            _asMember.Draw(dc);

            dc.DecLevel();
        }
Exemplo n.º 24
0
        public void Draw(MdxDrawContext dc)
        {
            _measure.Draw(dc);

            dc.Append(" - Sum (");

            _mdxElement.Draw(dc);

            dc.Append(".PREVMEMBER, ");

            _measure.Draw(dc);

            dc.Append(")");
        }
Exemplo n.º 25
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("DistinctCount (");

            int i = 0;

            foreach (var mdxBuilder in _mdxBuilders)
            {
                mdxBuilder.Draw(dc);
                dc.Append(i < _mdxBuilders.Count - 1 ? "," : "");

                i++;
            }

            dc.Append(")");
        }
Exemplo n.º 26
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("IIF (");

            _iifExpression.Draw(dc);

            dc.Append(", ");

            _trueValue.Draw(dc);

            dc.Append(", ");

            _falseValue.Draw(dc);

            dc.Append(")");
        }
Exemplo n.º 27
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("TopCount (");

            _setExpression.Draw(dc);

            dc.Append(string.Format(", {0}", _count));

            if (_measure != null)
            {
                dc.Append(", ");
                _measure.Draw(dc);
            }

            dc.Append(")");
        }
Exemplo n.º 28
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("NONEMPTY ");
            dc.OpenBracket("(");

            int i = 0;

            foreach (var mdxBuilder in _mdxBuilders)
            {
                mdxBuilder.Draw(dc);
                dc.Append(i < _mdxBuilders.Count - 1 ? "," : "");

                i++;
            }

            dc.CloseBracket(")");
        }
Exemplo n.º 29
0
        public void Draw(MdxDrawContext dc)
        {
            dc.Append("divide (");
            dc.Append("Sum (");

            _dimension.Draw(dc);

            dc.Append(", ");

            _measure.Draw(dc);

            dc.Append(")");

            dc.Append(",Count(");
            _dimension.Draw(dc);

            dc.Append("))");
        }
Exemplo n.º 30
0
        public void Draw(MdxDrawContext dc)
        {
            dc.AppendLine("WITH");
            dc.IncLevel();

            int i = 0;

            foreach (var measure in _members)
            {
                dc.BeginLine();

                measure.Draw(dc);

                dc.EndOfLine();
                i++;
            }

            dc.DecLevel();
        }