private void AddCellToNewLine(SectionLine newline, Cell cell)
 {
     cell.KeepPos = true;
     newline.Cells.Add(cell);
     newline.Cells.CalcRuntimeHeight(cell);
     newline.Section.Cells.Add(cell);
 }
Esempio n. 2
0
 private void RemoveFromTo(SectionLine sl, SectionLine slto)
 {
     foreach (Cell cell in sl.Cells)
     {
         slto.Cells.Add(cell);
     }
 }
Esempio n. 3
0
 public Row(SectionLine sl, Graphics g) : this(g)
 {
     _sectionline = sl;
     _level       = sl.Section.Level;
     _area        = sl.Section.Type;
     _bfirst      = sl.Index == 0;
     AddCells(null);
 }
Esempio n. 4
0
 public GroupHeaderRow(SectionLine sl, SemiRow semirow, Graphics gg)
     : base(sl, semirow, gg)
 {
     if ((sl.Section as IGroupHeader).bAloneLine)
     {
         _baloneline = true;
     }
 }
Esempio n. 5
0
 public Row(SectionLine sl, Graphics g, int containerwidth) : this(g)
 {
     _containerwidth = containerwidth;
     _sectionline    = sl;
     _level          = sl.Section.Level;
     _area           = sl.Section.Type;
     _bfirst         = sl.Index == 0;
     AddCells(null);
 }
 private bool bLastOneIntheLine(Cell cell, SectionLine sl)
 {
     foreach (Cell c in sl.Cells)
     {
         if (c.Y >= cell.Y + cell.Height && ((cell.X >= c.X && cell.X < c.X + c.Width) || (cell.X + cell.Width > c.X && cell.X + cell.Width <= c.X + c.Width)))
         {
             return(false);
         }
     }
     return(true);
 }
Esempio n. 7
0
 public void Insert(int index, SectionLine value)
 {
     if (index >= Count)
     {
         List.Add(value);
     }
     else
     {
         List.Insert(index, value);
     }
 }
Esempio n. 8
0
 public Row(SectionLine sl, SemiRow semirow, string baseid, Graphics g) : this(g)
 {
     if (baseid != null && semirow.Contains(baseid))
     {
         _baseid = Convert.ToInt32(semirow[baseid]);
     }
     _bminorlevel = semirow.bMinorLevel;
     _sectionline = sl;
     _level       = semirow.Level;
     _area        = sl.Section.Type;
     _bfirst      = sl.Index == 0;
     AddCells(semirow);
 }
Esempio n. 9
0
 public Row(SectionLine sl)
 {
     //_bautoheight = true;
     _cells            = sl.Cells;
     _cells.UnderState = ReportStates.Browse;
     _level            = sl.Section.Level;
     _area             = sl.Section.Type;
     _sectionline      = sl;
     _x            = _cells.X;
     _ybase        = _cells.Y;
     _expandheight = _cells.ExpandHeight;
     _metaheight   = _cells.MetaHeight;
 }
Esempio n. 10
0
 public int Add(SectionLine value)
 {
     for (int i = 0; i < Count; i++)
     {
         SectionLine sl = this[i];
         if (value.Cells.Count > 0 && sl.Cells.Count > 0 && value.Cells[0].Y < sl.Cells[0].Y)
         {
             Insert(i, value);
             return(i);
         }
     }
     return(List.Add(value));
 }
        private int bUnderAMetrix(Cell cell, SectionLine sl)
        {
            int offsize = 0;

            foreach (Cell c in sl.Cells)
            {
                if (c is IMetrix && cell.Y >= c.Y + c.Height && ((cell.X >= c.X && cell.X < c.X + c.Width) || (cell.X + cell.Width > c.X && cell.X + cell.Width <= c.X + c.Width)))
                {
                    offsize += (c as IMetrix).HeightOffsize;
                }
            }
            return(offsize);
        }
        //private int bRightAMetrix(Cell cell, SectionLine sl)
        //{
        //    int offsize = 0;
        //    foreach (Cell c in sl.Cells)
        //    {
        //        if (c is IMetrix && cell.X >= c.X + c.Width && ((cell.Y>=c.Y && cell.Y<c.Y+c.Height )||(cell.Y+cell.Height >c.Y && cell.Y+cell.Height<=c.Y+c.Height )))
        //            offsize += (c as IMetrix).WidthOffsize;
        //    }
        //    return offsize;
        //}
        private int bRightAMetrix(Cell cell, SectionLine sl)
        {
            int offsize = 0;

            foreach (Cell c in sl.Section.Cells)
            {
                if (c is IMetrix && cell.X >= c.X + c.Width)// && ((cell.Y >= c.Y && cell.Y < c.Y + c.Height) || (cell.Y + cell.Height > c.Y && cell.Y + cell.Height <= c.Y + c.Height)))
                {
                    offsize += (c as IMetrix).WidthOffsize;
                }
            }
            return(offsize);
        }
 private int FindTheLine(Cell metrix)
 {
     for (int i = 0; i < _currentlines.Count; i++)
     {
         SectionLine sl = _currentlines[i];
         foreach (Cell cell in sl.Cells)
         {
             if (cell == metrix)
             {
                 return(i);
             }
         }
     }
     return(-1);
 }
Esempio n. 14
0
        public void AsignToSectionLines()
        {
            _sectionlines.Clear();
            if (_cells.Count == 0)
            {
                SectionLine sl = new SectionLine(this);
                _sectionlines.Add(sl);
                return;
            }
            ArrayList al = new ArrayList();

            foreach (Cell value in _cells)
            {
                bool badded = false;
                al.Clear();
                SectionLine slto = null;
                foreach (SectionLine sl in _sectionlines)
                {
                    if (sl.ShouldContains(value))
                    {
                        if (!badded)
                        {
                            sl.Cells.Add(value);
                            slto   = sl;
                            badded = true;
                        }
                        else
                        {
                            RemoveFromTo(sl, slto);
                            al.Add(sl);
                        }
                    }
                }
                if (!badded)
                {
                    SectionLine sl = new SectionLine(this);
                    sl.Cells.Add(value);
                    _sectionlines.Add(sl);
                }
                else if (al.Count > 0)
                {
                    for (int i = 0; i < al.Count; i++)
                    {
                        _sectionlines.Remove((SectionLine)al[i]);
                    }
                }
            }
        }
        public override void BuildIndicatorMetrix(Report report, bool hasdrilldefined)
        {
            BuildTheLastMetrix();

            _currentmetrix = _currentcells[report.ViewID] as IMetrix;
            _currentreport = report;
            Section pagetitle = report.Sections[SectionType.PageTitle];

            if (bChartDataSource)
            {
                CreateDataTable(pagetitle);
            }
            if (hasdrilldefined)
            {
                if ((_currentmetrix as Cell).Visible || _currenttable != null)
                {
                    CreateNameToColumnMap();
                    if (_currenttable != null)
                    {
                        _chartdrilldata = new DrillData(_viewid, report.ViewID);
                    }
                }
            }

            if ((_currentmetrix as Cell).Visible)
            {
                int index = FindTheLine(_currentmetrix as Cell);
                _currentline = _currentlines[index];

                _currentx = (_currentmetrix as Cell).X + bRightAMetrix(_currentmetrix as Cell, _currentline);
                _currenty = (_currentmetrix as Cell).Y + bUnderAMetrix(_currentmetrix as Cell, _currentline);
                _beginy   = _currenty;

                _newline = _detail.SectionLines[index];

                foreach (Section section in report.Sections)
                {
                    section.AsignToSectionLines();
                    //if (section is GroupHeader)
                    //{
                    //    foreach (Cell cell in section.Cells)
                    //        cell.Border.AllBorder();
                    //}
                }

                _rows.AppendFrom(pagetitle);
            }
        }
        public IndicatorDetailBuilder(string viewid, IndicatorDetail indicatordetail, Detail detail, SemiRowsContainer semirowscontainer)
        {
            _viewid = viewid;
            indicatordetail.AsignToSectionLines();
            _currentcells = indicatordetail.Cells;
            _currentlines = indicatordetail.SectionLines;

            _detail            = detail;
            _detail.UnderState = ReportStates.Browse;
            _semirowscontainer = semirowscontainer;
            _rows = new Rows();

            for (int i = 0; i < _currentlines.Count; i++)
            {
                _newline = new SectionLine(_detail);
                _detail.SectionLines.Add(_newline);
            }

            _data = new DataSet();
        }
        public override void EndBuild()
        {
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(ClientReportContext.LocaleID);
            BuildTheLastMetrix();
            bool bonlychartorgauge = bOnlyOneChartOrGaugeVisible;

            for (int i = 0; i < _currentlines.Count; i++)
            {
                SectionLine sl      = _currentlines[i];
                SectionLine newline = _detail.SectionLines[i];
                foreach (Cell cell in sl.Cells)
                {
                    if (!cell.Visible)
                    {
                        continue;
                    }
                    if (cell is IMetrix)
                    {
                        continue;
                    }
                    if (cell is Chart)
                    {
                        (cell as Chart).Data = _data.Tables[(cell as Chart).DataSource];
                    }
                    if (cell is Gauge)
                    {
                        (cell as Gauge).Indicator = _currentcells[(cell as Gauge).IndicatorName] as CalculatorIndicator;
                    }
                    int yoffsize = bUnderAMetrix(cell, sl);
                    cell.SetY(cell.Y + yoffsize);
                    int xoffsize = bRightAMetrix(cell, sl);
                    cell.X += xoffsize;
                    AddCellToNewLine(newline, cell);

                    if (!bonlychartorgauge && cell is IGap && (cell as IGap).GapHeight > 0 && bLastOneIntheLine(cell, sl))
                    {
                        AddCellToNewLine(newline, GetAGap(cell as IGap));
                    }
                }
            }
        }
Esempio n. 18
0
 public SectionLine(SectionLine sectionline)
 {
     _section = sectionline.Section;
     _cells   = sectionline.Cells.Clone() as Cells;
 }
Esempio n. 19
0
 public GroupRow(SectionLine sl, SemiRow semirow, Graphics gg)
     : base(sl, semirow, null, gg)
 {
 }
Esempio n. 20
0
 public bool Contains(SectionLine value)
 {
     return(List.Contains(value));
 }
Esempio n. 21
0
 public void Remove(SectionLine value)
 {
     List.Remove(value);
 }
Esempio n. 22
0
        public void AddAfter(SectionLine a, SectionLine b)
        {
            int index = IndexOf(a);

            Insert(index + 1, b);
        }
Esempio n. 23
0
 public int IndexOf(SectionLine value)
 {
     return(List.IndexOf(value));
 }