Exemple #1
0
 private void AddKey(ref SimpleArrayList list, string key)
 {
     if (list == null)
     {
         list = new SimpleArrayList();
     }
     list.Add(key);
 }
        private void FillDataTable(SemiRows semirows)
        {
            foreach (SemiRow semirow in semirows)
            {
                if (semirow.Level == 0)
                {
                    continue;
                }
                DataRow dr = _currenttable.NewRow();
                _currenttable.Rows.Add(dr);

                string groupkey = null;
                foreach (string key in _captiontoname.Keys)
                {
                    object o = _captiontoname[key];
                    if (o != null)
                    {
                        if (o is string)
                        {
                            string v = semirow[o.ToString()].ToString();
                            if (v == "")
                            {
                                dr[key] = DBNull.Value;
                            }
                            else
                            {
                                dr[key] = v;
                            }
                        }
                        else if (o is SimpleArrayList)
                        {
                            SimpleArrayList sal = o as SimpleArrayList;
                            StringBuilder   sb  = new StringBuilder();
                            foreach (string s in sal)
                            {
                                if (sb.Length > 0)
                                {
                                    sb.Append(" ");
                                }
                                sb.Append(semirow[s].ToString());
                            }
                            groupkey = sb.ToString();
                            dr[key]  = groupkey;
                        }
                    }
                }
                if (_cellnametocolumnname != null)
                {
                    DrillData dd = new DrillData(_viewid, ((Cell)_currentmetrix).Name);
                    foreach (string key in _cellnametocolumnname.Keys)
                    {
                        dd.Add(_cellnametocolumnname[key].ToString(), semirow[key]);
                    }

                    _chartdrilldata.Add(groupkey, dd);
                }
            }
        }
        public object Clone()
        {
            SimpleArrayList al = new SimpleArrayList();

            foreach (string key in this)
            {
                al.Add(key);
            }
            return(al);
        }
Exemple #4
0
        public Cell GetByGroupKeyWhenCheckGroup(string mapname)
        {
            Cell            c        = null;
            SimpleArrayList mapnames = new SimpleArrayList();

            foreach (Cell cell in this)
            {
                if (cell.Name.ToLower() == mapname.ToLower() || ((cell is IMapName) && (cell as IMapName).MapName.ToLower() == mapname.ToLower()))
                {
                    if (cell is GridProportionDecimal)//占比列不能作为分组 add by yanghx 2012-6-30
                    {
                        continue;
                    }
                    c = cell;
                    if (c is IMapName && (c as IMapName).MapName.ToLower() != mapname.ToLower())
                    {
                        mapnames.Add((c as IMapName).MapName);
                    }
                    if (c is IGridCollect && (c as IGridCollect).bSummary)
                    {
                        (c as IGridCollect).bSummary = false;
                    }
                    break;
                }
                else if (cell is IGridCollect && (cell as IGridCollect).bSummary && (cell as IGridCollect).Operator == OperatorType.ExpressionSUM && ExpressionSumContains(cell, mapname))
                {
                    (cell as IGridCollect).bSummary = false;
                }
            }
            foreach (string mp in mapnames)
            {
                foreach (Cell cell in this)
                {
                    if (cell.Name.ToLower() == mp.ToLower() || ((cell is IMapName) && (cell as IMapName).MapName.ToLower() == mp.ToLower()))
                    {
                        if (cell is IGridCollect && (cell as IGridCollect).bSummary)
                        {
                            (cell as IGridCollect).bSummary = false;
                        }
                    }
                    else if (cell is IGridCollect && (cell as IGridCollect).bSummary && (cell as IGridCollect).Operator == OperatorType.ExpressionSUM && ExpressionSumContains(cell, mp))
                    {
                        (cell as IGridCollect).bSummary = false;
                    }
                }
            }
            return(c);
        }
        private void CreateDataTable(Section pagetitle)//from pagetitle,designcaption=null, to be x; ____ to be none; a___b to be two new columns; others to be a new column
        {
            _captiontoname             = new SimpleHashtable();
            _designcaptiontodesignname = new SimpleHashtable();
            _designcaptiontodesignname.Add("__bcross__", _currentreport.Type == ReportType.CrossReport);
            _currenttable = new DataTable((_currentmetrix as Cell).Name);
            AddATableColumn("X", new SimpleArrayList(), typeof(string), null, null);
            _data.Tables.Add(_currenttable);

            foreach (Cell cell in pagetitle.Cells)
            {
                if (cell is Label)
                {
                    Label l = cell as Label;
                    if (l.DesignCaption != "____")
                    {
                        if (l is SuperLabel)
                        {
                            foreach (Label sl in (l as SuperLabel).Labels)
                            {
                                if (!string.IsNullOrEmpty(sl.DesignCaption) && sl.DesignCaption != "____")
                                {
                                    AddATableColumn(l.Caption + "____" + sl.Caption, sl.Name, typeof(decimal), sl.Caption, sl.DesignName);
                                }
                                //AddATableColumn(l.DesignCaption + "____" + sl.DesignCaption, sl.Name, typeof(decimal), sl.DesignCaption, sl.DesignName);
                            }
                        }
                        else if (string.IsNullOrEmpty(l.DesignCaption))//x
                        {
                            SimpleArrayList sal = _captiontoname["X"] as SimpleArrayList;
                            sal.Add(l.Name);
                        }
                        else
                        {
                            AddATableColumn(l.Caption, l.Name, typeof(decimal), l.Caption, l.DesignName);
                            //AddATableColumn(l.DesignCaption, l.Name, typeof(decimal), l.DesignCaption, l.DesignName);
                        }
                    }
                }
            }
        }
Exemple #6
0
 public Group(int level, SqlDataReader reader, SimpleArrayList columns) : this(level, reader)
 {
     _columns = columns;
 }
 public void Dispose()
 {
     this._items.Clear();
     this._items = null;
 }
 public GroupSchemaItem()
 {
     _items = new SimpleArrayList();
 }