Exemplo n.º 1
0
        public ReportBuilder(Page page, VwbQuery query)
        {
            _page  = page;
            _query = query.Clone();
            IEnumerable <string> immutableColKeys = ColumnFactory.ImmutableColumns.Select(i => i.Key());

            if (_query.SortColumnKey != null && !_query.ColumnKeysInOrder.Contains(_query.SortColumnKey) &&
                !immutableColKeys.Contains(_query.SortColumnKey))
            {
                _query.SortColumnKey = null;
            }
            if (string.IsNullOrEmpty(_query.SortColumnKey))
            {             //if no sort defined, sort by article number
                _query.SortColumnKey = ColumnFactory.GetArticleNumberColumn().Key();
            }
        }