コード例 #1
0
        public bool bInThisRow(RuntimeGroup group)
        {
            bool bin = bInAGroup(group);

            if (!bin)
            {
                return(false);
            }

            GroupHeaderRow parent = this;

            for (int i = group.Level - 1; i > 0; i--)
            {
                parent = parent.ParentRow;
                bin    = parent.bInAGroup(group.UpperGroup(i));
                if (!bin)
                {
                    return(false);
                }
            }
            return(true);
        }
コード例 #2
0
ファイル: Rows.cs プロジェクト: kkmeteor/StudyProjects
 private void AppendFrom(Section section, SemiRow semirow, ShowStyle showstyle, string baseid, System.Drawing.Graphics g)
 {
     if (section == null || (_nogroupheader && section.Type == "GroupHeader"))
     {
         return;
     }
     foreach (SectionLine sl in section.SectionLines)
     {
         if (sl.Cells.Count > 0)
         {
             if (section is GroupHeader)
             {
                 GroupHeaderRow row = new GroupHeaderRow(sl, semirow, g);
                 SetRowState(showstyle, row);
                 _parentrows.Add(row.Level.ToString(), row);
                 if (row.Level > 1)
                 {
                     row.ParentRow = _parentrows[Convert.ToString(row.Level - 1)] as GroupHeaderRow;
                 }
                 Add(row);
             }
             else if (section is GroupSummary)
             {
                 GroupRow row = new GroupRow(sl, semirow, g);
                 SetRowState(showstyle, row);
                 row.ParentRow = _parentrows[Convert.ToString(row.Level)] as GroupHeaderRow;
                 Add(row);
             }
             else
             {
                 Row row = new Row(sl, semirow, baseid, g);
                 SetRowState(showstyle, row);
                 row.ParentRow = _parentrows[Convert.ToString(row.Level - 1)] as GroupHeaderRow;
                 Add(row);
             }
         }
     }
 }
コード例 #3
0
ファイル: Row.cs プロジェクト: kkmeteor/StudyProjects
        private void DrawCell(Cell c, int width, int height, int y, Graphics g)
        {
            if (!c.Visible)
            {
                return;
            }
            if (c is Expression)
            {
                string formula = (c as Expression).Formula.FormulaExpression.ToLower();
                if (formula == "page()")
                {
                    int pageindex = _pageindex + 1;//* _pagesinpage + _pageoffsize;
                    formula   = formula.Replace("page()", pageindex.ToString());
                    c.Caption = formula;
                }
                else if (formula == "pages()")
                {
                    int pages = _pages * _pagesinpage;
                    formula   = formula.Replace("pages()", pages.ToString());
                    c.Caption = formula;
                }
                else if (formula == "grouppage()")
                {
                    c.Caption = (_printpage == null? "" : Convert.ToString((_printpage.GroupPageIndex - 1) * _pagesinpage + _pageoffsize));
                }
                else if (formula == "grouppages()")
                {
                    c.Caption = (_printpage == null? "" : Convert.ToString(_printpage.GroupPages * _pagesinpage));
                }
                else if (c.GetStateType() == "PrintExpression")
                {
                    object o = (_printpage == null ? "": _printpage.GetValue(c));
                    if (o != null)
                    {
                        c.Caption = o.ToString();
                    }
                    else
                    {
                        c.Caption = "";
                    }
                }
            }
            else if (c is Chart)
            {
                #region chart
                Chart chart = c as Chart;
                if (chart.bNullChart)
                {
                    try
                    {
                        Infragistics.Win.UltraWinChart.UltraChart mychart = new Infragistics.Win.UltraWinChart.UltraChart();
                        chart.MyChart = mychart;
                        ChartService cs = null;
                        if (_report.Type == ReportType.IndicatorReport)
                        {
                            cs = new IndicatorChartService(_report, chart.CaptionToName);
                        }
                        else
                        {
                            cs = new ChartService(_report);
                        }
                        cs.InitializeChart(chart.Level, null, mychart);
                        if (chart.Data == null)
                        {
                            RuntimeGroup group = null;
                            if (chart.Level > 1)
                            {
                                group = AddARuntimeGroup(_report);
                                GroupHeaderRow pr = (this as GroupRow).ParentRow;
                                while (pr != null)
                                {
                                    group.AddAUpperGroup(pr.AddARuntimeGroup(_report));
                                    pr = pr.ParentRow;
                                }
                            }
                            mychart.Data.DataSource = cs.GetDataSource(chart.Level, null, group, mychart.ChartType);
                        }
                        else
                        {
                            mychart.Data.DataSource = cs.GetDataSource(chart.Level, null, chart.Data, mychart.ChartType);
                        }

                        mychart.Data.DataBind();
                    }
                    catch (Exception e)
                    {
                        chart.Caption         = e.Message;
                        chart.bExceptionChart = true;
                    }
                }
                #endregion
            }
            int x = ConvertFromInternalToControl(c.X);
            if (width != -1 && (x >= width || x + c.Width <= 0))
            {
                return;
            }

            int h;
            int ycor = y;
            if (c is SuperLabel)
            {
                if (_bautoheight)
                {
                    h = c.RuntimeHeight;
                }
                else
                {
                    h = c.Height;
                }
            }
            else
            {
                if (_bautoheight)
                {
                    h = c.ExpandHeight;
                }
                else
                {
                    h = c.MetaHeight;
                }
            }

            int celly = c.Y;
            if (c is Label && _bautoheight)
            {
                if (celly < (c as Label).AutoHeightY)
                {
                    celly = (c as Label).AutoHeightY;
                }
            }

            //if(! (c is SubReport))
            //{
            if (c.KeepPos)
            {
                ycor += celly - _ybase;
            }
            else
            {
                h = this.Height;
            }
            //}
            c.bActive      = false;
            c.bInActiveRow = false;
            if (bActiveCell != null && bActiveCell(c))
            {
                c.bActive = true;
            }
            if (bActiveRow != null && bActiveRow(this) && hasActiveCell != null && hasActiveCell())//!hasActiveCell()
            {
                c.bInActiveRow = true;
            }


            DrawIt(c, g, x, ycor, width, height, h);
        }