Ejemplo n.º 1
0
        public override Categories GetCategories(Rdl.Runtime.Context context, Category parentCategory)
        {
            List <Category> result = new List <Category>();

            Rdl.Runtime.Context ctxt = context.GetChildContext(null, null, _grouping, _sorting);

            while (ctxt.GroupIndex < ctxt.GroupCount)
            {
                string value;
                if (_label != null && !_label.Empty)
                {
                    value = _label.ExecAsString(ctxt);
                }
                else
                {
                    value = ctxt.CurrentGroupValue;
                }
                result.Add(new Category(ctxt, this, parentCategory, value));

                ctxt.NextGroup();
            }

            return(new Categories(result));
        }
Ejemplo n.º 2
0
        public override SeriesList GetSeriesList(Rdl.Runtime.Context context, Series parentSeries)
        {
            List <Series> result = new List <Series>();

            Rdl.Runtime.Context ctxt = context.GetChildContext(null, null, _grouping, _sorting);

            while (ctxt.GroupIndex < ctxt.GroupCount)
            {
                string value;
                if (_label != null && !_label.Empty)
                {
                    value = _label.ExecAsString(ctxt);
                }
                else
                {
                    value = ctxt.CurrentGroupValue;
                }
                result.Add(new Series(ctxt, this, parentSeries, value));

                ctxt.NextGroup();
            }

            return(new SeriesList(result));
        }
Ejemplo n.º 3
0
        internal override void Render(Rdl.Render.Container box, Rdl.Runtime.Context context)
        {
            bool hidden = false;

            context = new Rdl.Runtime.Context(
                context,
                null,
                null,
                _grouping,
                _sortBy);

            TextBox tb = FindToggleItem(_visibility);

            if (_visibility != null && _visibility.ToggleItem == null)
            {
                hidden = _visibility.IsHidden(context);
            }
            ;

            // Loop through all of the rows in the data context
            decimal top = 0;

            while (true)
            {
                if (_grouping == null && context.CurrentRow == null)
                {
                    break;
                }
                if (_grouping != null && context.GroupIndex >= context.GroupCount)
                {
                    break;
                }

                foreach (Row tr in _tableRows)
                {
                    Rdl.Render.FixedContainer rowBox = null;
                    if (box != null && !hidden)
                    {
                        rowBox             = box.AddFixedContainer(this, Style, context);
                        rowBox.Name        = "RowBox";
                        rowBox.Top         = top;
                        rowBox.Width       = box.Width;
                        rowBox.ContextBase = true;

                        if (tb != null)
                        {
                            tb.LinkedToggles.Add(new Toggle(rowBox, tb));
                        }
                    }

                    tr.Render(rowBox, context);

                    if (box != null && !hidden)
                    {
                        top       += rowBox.Height;
                        box.Height = top;
                    }
                }

                context.LinkToggles();
                if (_grouping == null)
                {
                    context.MoveNext();
                }
                else
                {
                    context.NextGroup();
                }
            }
        }
Ejemplo n.º 4
0
        internal override void Render(Rdl.Render.Container box, Rdl.Runtime.Context context)
        {
            Rdl.Runtime.Context context1 = context.GetChildContext(
                null,
                null,
                _grouping,
                _sorting);

            base.Render(box, context1);

            bool hidden = false;

            if (_visibility != null && _visibility.ToggleItem == null)
            {
                hidden = _visibility.IsHidden(context1);
            }

            if (!hidden)
            {
                TextBox tb = Report.FindToggleItem(_visibility);

                Rdl.Render.FlowContainer dynamicRowsBox = null;
                if (box != null)
                {
                    // The dynamic rows box is a top down box holding all of the rows
                    // in the matrix including the total row.
                    dynamicRowsBox = box.AddFlowContainer(this, Style, context, Rdl.Render.FlowContainer.FlowDirectionEnum.TopDown);
                    dynamicRowsBox.MatchParentWidth = true;
                    dynamicRowsBox.Name             = "DynamicRows";
                }

                if ((_subtotal != null && _subtotal.Position == Subtotal.PositionEnum.Before) ||
                    (tb != null && _subtotal == null))
                {
                    RenderSubtotal(dynamicRowsBox, context, hidden, (_subtotal == null) ? tb : null);
                }

                while (context1.GroupIndex < context1.GroupCount)
                {
                    Rdl.Render.FlowContainer rowGroupBox = dynamicRowsBox.AddFlowContainer(this, Style, context1, Rdl.Render.FlowContainer.FlowDirectionEnum.LeftToRight);
                    rowGroupBox.Name = "DynamicRow";

                    if (tb != null)
                    {
                        tb.LinkedToggles.Add(new Toggle(rowGroupBox, tb));
                    }

                    Rdl.Render.FixedContainer rowGroupHeader = rowGroupBox.AddFixedContainer(this, Style, context1);
                    rowGroupHeader.Name              = "DynamicRowHeader";
                    rowGroupHeader.Width             = Width.points;
                    rowGroupHeader.MatchParentHeight = true;
                    //rowGroupHeader.Height = FindMatrix(this).Rows.Height;
                    rowGroupHeader.CanGrowHorizonally = false;
                    _reportItems.Render(rowGroupHeader, context1);

                    if (RenderNext != null)
                    {
                        if (RenderNext is RowGrouping)
                        {
                            //Rdl.Render.FlowContainer contentBox = rowGroupBox.AddFlowContainer(this, Style, context1, Rdl.Render.FlowContainer.FlowDirectionEnum.TopDown);
                            //contentBox.Name = "DynamicRowContent";
                            ((RowGrouping)RenderNext).Render(rowGroupBox, context1);
                        }
                        else if (RenderNext is ColumnGrouping)
                        {
                            ((ColumnGrouping)RenderNext).Render(rowGroupBox, FindMatrix(this).Context, context1, 0);
                        }
                        else
                        {
                            RenderNext.Render(rowGroupBox, context1);
                        }

                        //// Intersect the rows in the current column grouping with the rows in the
                        //// row grouping and if there is anything left then render the
                        //// MatrixRows.
                        //Rdl.Runtime.Context tmpContext = context1.Intersect(columnContext);
                    }

                    context1.LinkToggles();
                    context1.NextGroup();
                }

                if (_subtotal != null && _subtotal.Position == Subtotal.PositionEnum.After)
                {
                    RenderSubtotal(box, context, hidden, null);
                }
            }
        }
Ejemplo n.º 5
0
        internal override void Render(Rdl.Render.Container box, Rdl.Runtime.Context context)
        {
            Rdl.Render.FlowContainer headerBox  = null;
            Rdl.Render.FlowContainer detailsBox = null;
            Rdl.Render.FlowContainer footerBox  = null;
            Rdl.Render.FlowContainer groupRow   = null;

            context = new Rdl.Runtime.Context(
                context,
                null,
                null,
                _grouping,
                _sortBy);

            TextBox tb = Report.FindToggleItem(_visibility);

            if (box != null && !_visibility.IsHidden(context))
            {
                _box       = box.AddFlowContainer(this, Style, context, Rdl.Render.FlowContainer.FlowDirectionEnum.TopDown);
                _box.Width = box.Width;
                _box.Name  = "TableGroup";

                if (tb != null)
                {
                    tb.LinkedToggles.Add(new Toggle(_box, tb));
                }
            }

            // Render the header
            decimal groupTop = 0;

            while (context.GroupIndex < context.GroupCount)
            {
                if (_box != null)
                {
                    groupRow                 = _box.AddFlowContainer(this, Style, context, Rdl.Render.FlowContainer.FlowDirectionEnum.TopDown);
                    groupRow.Width           = _box.Width;
                    groupRow.Top             = groupTop;
                    groupRow.Name            = "GroupRrow";
                    groupRow.ContextBase     = true;
                    groupRow.PageBreakBefore = _grouping.PageBreakAtStart;
                    // Don't break page on last group item.
                    groupRow.PageBreakAfter = (context.GroupIndex + 1 < context.GroupCount) ? _grouping.PageBreakAtEnd : false;
                }

                if (_header != null)
                {
                    if (_box != null)
                    {
                        headerBox       = groupRow.AddFlowContainer(this, _header.Style, context, Rdl.Render.FlowContainer.FlowDirectionEnum.TopDown);
                        headerBox.Top   = 0;
                        headerBox.Width = groupRow.Width;
                        headerBox.Name  = "GroupHeader";
                    }

                    _header.Render(headerBox, context);
                }

                // Create a box to hold the details and tie that
                // box to any repeat lists referencing these details.
                if (_details != null && groupRow != null)
                {
                    detailsBox       = groupRow.AddFlowContainer(this, _details.Style, context, Rdl.Render.FlowContainer.FlowDirectionEnum.TopDown);
                    detailsBox.Top   = (headerBox == null) ? 0 : headerBox.Height;
                    detailsBox.Width = groupRow.Width;
                    detailsBox.Name  = "GroupDetails";

                    // If the header or footer are repeated, then add them to the repeat list of the details.
                    if (_header != null && _header.RepeatOnNewPage)
                    {
                        detailsBox.RepeatList.Add(headerBox);
                    }
                    if (_footer != null && _footer.RepeatOnNewPage)
                    {
                        detailsBox.RepeatList.Add(footerBox);
                    }
                }

                // Render the details.
                if (_details != null)
                {
                    _details.Render(detailsBox, context);
                }

                // Render the footer.
                if (_footer != null)
                {
                    if (groupRow != null)
                    {
                        footerBox      = groupRow.AddFlowContainer(this, _footer.Style, context, Rdl.Render.FlowContainer.FlowDirectionEnum.TopDown);
                        footerBox.Name = "GroupFooter";
                        footerBox.Top  = ((headerBox == null) ? 0 : headerBox.Height) +
                                         ((detailsBox == null) ? 0 : detailsBox.Height);
                        footerBox.Width = _box.Width;
                    }
                    context.RowIndex = 0;
                    _footer.Render(footerBox, context);
                }

                if (groupRow != null)
                {
                    groupTop += groupRow.Height;
                }

                context.LinkToggles();
                context.NextGroup();
            }
        }
Ejemplo n.º 6
0
        internal override int RenderHeader(Rdl.Render.Container box, Rdl.Runtime.Context context, int column)
        {
            Rdl.Runtime.Context context1 = context.GetChildContext(
                null,
                null,
                _grouping,
                _sorting);

            bool hidden = false;

            if (_visibility != null && _visibility.ToggleItem == null)
            {
                hidden = _visibility.IsHidden(context1);
            }

            TextBox tb = Report.FindToggleItem(_visibility);

            if ((_subtotal != null && _subtotal.Position == Subtotal.PositionEnum.Before) ||
                (tb != null && _subtotal == null))
            {
                column = RenderSubTotalHeader(box, context, hidden, (_subtotal == null) ? tb : null, column);
            }

            while (context1.GroupIndex < context1.GroupCount && !hidden)
            {
                Rdl.Render.FlowContainer cell = box.AddFlowContainer(this, Style, context1, Rdl.Render.FlowContainer.FlowDirectionEnum.TopDown);
                cell.Name = "DynamicColumnHeader";
                cell.MatchParentHeight = true;

                Rdl.Render.FixedContainer contentBox = cell.AddFixedContainer(this, Style, context1);
                contentBox.Name              = "DynamicColumnContent";
                contentBox.Width             = FindMatrix(this).ColumnWidth;
                contentBox.Height            = _height.points;
                contentBox.MatchParentHeight = true;
                _reportItems.Render(contentBox, context1);

                if (tb != null)
                {
                    tb.LinkedToggles.Add(new Toggle(cell, tb));
                }

                // Save the text elements so we can link toggles in Render
                foreach (TextBox tb2 in context1.TextBoxes.Values)
                {
                    if (!_headerTextElements.ContainsKey(column))
                    {
                        _headerTextElements[column] = new List <Rdl.Render.TextElement>();
                    }
                    _headerTextElements[column].Add(tb2.TextElement);
                }

                if (RenderNext != null && RenderNext is ColumnGrouping)
                {
                    Rdl.Render.FlowContainer columnHeader = cell.AddFlowContainer(this, Style, context1, Rdl.Render.FlowContainer.FlowDirectionEnum.LeftToRight);
                    columnHeader.Name        = "ColumnGrouping";
                    columnHeader.ContextBase = true;

                    column = ((ColumnGrouping)RenderNext).RenderHeader(columnHeader, context1, column);
                }
                else
                {
                    contentBox.MatchParentHeight = true;
                    column++;
                }

                context1.LinkToggles();
                context1.NextGroup();
            }

            if (_subtotal != null && _subtotal.Position == Subtotal.PositionEnum.After)
            {
                column = RenderSubTotalHeader(box, context, hidden, tb, column);
            }

            return(column);
        }
Ejemplo n.º 7
0
        internal override int Render(Rdl.Render.Container box, Rdl.Runtime.Context context, Rdl.Runtime.Context rowContext, int column)
        {
            Rdl.Runtime.Context context1 = context.GetChildContext(null, null, _grouping, _sorting);

            bool hidden = false;

            if (_visibility != null && _visibility.ToggleItem == null)
            {
                hidden = _visibility.IsHidden(context1);
            }

            if (!hidden)
            {
                TextBox tb = Report.FindToggleItem(_visibility);

                if ((_subtotal != null && _subtotal.Position == Subtotal.PositionEnum.Before) ||
                    (tb != null && _subtotal == null))
                {
                    column = RenderSubtotal(box, context.Intersect(rowContext), hidden, (_subtotal == null) ? tb : null, column);
                }

                Rdl.Render.FlowContainer groupBox = null;
                if (box != null)
                {
                    groupBox      = box.AddFlowContainer(this, Style, context1, Rdl.Render.FlowContainer.FlowDirectionEnum.LeftToRight);
                    groupBox.Name = "DynamicColumnGroup";
                    groupBox.MatchParentHeight = true;
                }

                while (context1.GroupIndex < context1.GroupCount)
                {
                    Rdl.Render.FixedContainer groupEntryBox = null;
                    if (groupBox != null)
                    {
                        groupEntryBox = groupBox.AddFixedContainer(this, Style, context1);
                        groupEntryBox.MatchParentHeight = true;
                        if (tb != null)
                        {
                            tb.LinkedToggles.Add(new Toggle(groupEntryBox, tb));
                        }
                    }

                    // Put the column header text boxes into the column context and
                    // set the text element for any textboxes in the header of the column so that
                    // cells toggled on the header columns link to the correct boxes.
                    if (_headerTextElements.ContainsKey(column))
                    {
                        foreach (Rdl.Render.TextElement te in _headerTextElements[column])
                        {
                            context1.TextBoxes[((TextBox)te.ReportElement).Name] = (TextBox)te.ReportElement;
                            ((TextBox)te.ReportElement).Box = te;
                        }
                    }

                    // Render the details.
                    if (RenderNext != null)
                    {
                        if (RenderNext is ColumnGrouping)
                        {
                            column = ((ColumnGrouping)RenderNext).Render(groupEntryBox, context1, rowContext, column);
                        }
                        else
                        {
                            groupBox.Height = FindMatrix(this).Rows.Height;
                            RenderNext.Render(groupEntryBox, context1.Intersect(rowContext));
                            column++;
                        }
                    }

                    // Link the toggles at this context level with the linked elements contained.
                    context1.LinkToggles();
                    context1.NextGroup();
                }

                if (_subtotal != null && _subtotal.Position == Subtotal.PositionEnum.After)
                {
                    column = RenderSubtotal(box, context.Intersect(rowContext), hidden, null, column);
                }
            }

            return(column);
        }