示例#1
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);
                }
            }
        }
示例#2
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);
        }