Exemple #1
0
        public void Render(Rdl.Render.Container box, Rdl.Runtime.Context context, ref decimal cellPos)
        {
            Table table = FindTable(this);

            Rdl.Render.FixedContainer cellBox = null;

            bool visible = true;

            if (table.TableColumns[_colIndex].Visibility != null && table.TableColumns[_colIndex].Visibility.IsHidden(context) && table.TableColumns[_colIndex].Visibility.ToggleItem == null)
            {
                visible = false;
            }
            if (box != null && visible)
            {
                cellBox      = box.AddFixedContainer(this, Style, context);
                cellBox.Name = "TableCell";
                cellBox.Left = cellPos;
                for (int i = 0; i < _colSpan; i++)
                {
                    cellBox.Width += table.TableColumns[_colIndex + i].Width.points;
                }
                cellBox.Height            = box.Height;
                cellBox.MatchParentHeight = true;

                cellPos += cellBox.Width;
            }

            if (_reportItems != null)
            {
                _reportItems.Render(cellBox, context);
            }
        }
        private int RenderSubTotalHeader(Rdl.Render.Container box, Rdl.Runtime.Context context, bool hidden, TextBox tb, int column)
        {
            Rdl.Render.FixedContainer cell = null;

            if (box != null && !hidden)
            {
                cell      = box.AddFixedContainer(this, Style, context);
                cell.Name = "SubtotalColumnHeader";
                //cell.Height = TotalHeight;
                cell.Width             = FindMatrix(this).ColumnWidth;
                cell.MatchParentHeight = true;
                //cell.CanGrowVertically = false;

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

            if (_subtotal != null)
            {
                _subtotal.ReportItems.Render(cell, context);
            }
            return(column + 1);
        }
Exemple #3
0
        protected override void Render2(Rdl.Runtime.Context context)
        {
            base.Render2(context);

            while (_context.GroupIndex < _context.GroupCount)
            {
                Rdl.Render.FixedContainer cell = null;
                if (_box != null && _dataElementOutput == Enums.DataElementOutputEnum.Auto)
                {
                    bool first = (cell == null);
                    cell                  = ((Rdl.Render.Container)_box).AddFixedContainer(this, Style, context);
                    cell.Name             = "ListItem";
                    cell.MatchParentWidth = true;
                    // If this isn't the first group item and PageBreakAtStart then break before the container
                    if (!first && _grouping != null && _grouping.PageBreakAtStart)
                    {
                        cell.PageBreakBefore = _grouping.PageBreakAtStart;
                    }
                    // If this isn't the last group item and PageBreakAtEnd then break after the container
                    if (_context.GroupIndex < _context.GroupCount - 1 && _grouping != null && _grouping.PageBreakAtEnd)
                    {
                        cell.PageBreakAfter = _grouping.PageBreakAtEnd;
                    }
                }

                _reportItems.Render(cell, _context);

                _context.LinkToggles();
                _context.NextGroup();
            }
        }
        private int RenderSubtotal(Rdl.Render.Container box, Rdl.Runtime.Context context, bool hidden, TextBox tb, int column)
        {
            Rdl.Render.FixedContainer cell = null;

            if (!hidden && box != null)
            {
                cell      = box.AddFixedContainer(this, Style, context);
                cell.Name = "DynamicColumnSubtotal";
                //cell.Width = FindMatrix(this).ColumnWidth;
                cell.Height            = Height.points;
                cell.MatchParentHeight = true;
                if (tb != null)
                {
                    tb.LinkedToggles.Add(new Toggle(cell, tb, Enums.ToggleDirectionEnum.negative));
                }

                // Render the details.
                MatrixElement m = RenderNext;
                while (m is ColumnGrouping)
                {
                    m = ((ColumnGrouping)m).RenderNext;
                }

                m.Render(cell, context);
            }
            return(column + 1);
        }
Exemple #5
0
        internal override void Render(Rdl.Render.Container box, Rdl.Runtime.Context context)
        {
            Rdl.Render.FixedContainer bodyBox = null;

            if (box == null)
            {
                bodyBox = new Rdl.Render.FixedContainer(null, this, new Rdl.Render.BoxStyle(Style, context));
            }
            else
            {
                bodyBox = box.AddFixedContainer(this, Style, context);
            }

            bodyBox.Name          = "Body";
            bodyBox.Columns       = _columns;
            bodyBox.ColumnSpacing = _columnSpacing.points;
            bodyBox.Height        = _height.points;
            bodyBox.Width         = box.Width;

            if (_columns > 1)
            {
                bodyBox.Width = (bodyBox.Width / _columns) -
                                (_columnSpacing.points * (_columns - 1));
            }

            _reportItems.Render(bodyBox, context);
        }
Exemple #6
0
        internal override int RenderHeader(Rdl.Render.Container box, Rdl.Runtime.Context context, int column)
        {
            for (int i = 0; i < _staticColumns.Count; i++)
            {
                ReportItems item = _staticColumns[i];
                Rdl.Render.FixedContainer contentBox = null;

                if (box != null)
                {
                    contentBox                   = box.AddFixedContainer(this, Style, context);
                    contentBox.Name              = "StaticColumnContent";
                    contentBox.Height            = Height.points;
                    contentBox.MatchParentHeight = true;
                    contentBox.Width             = FindMatrix(this).Columns[i].Width;
                    contentBox.CanGrowVertically = false;
                }

                item.Render(contentBox, context);
            }

            if (RenderNext != null && RenderNext is RowGrouping)
            {
                column = ((ColumnGrouping)RenderNext).RenderHeader(box, context, column);
            }
            else if (RenderNext != null)
            {
                column++;
            }

            return(column);
        }
Exemple #7
0
        internal override void Render(Rdl.Render.Container box, Rdl.Runtime.Context context)
        {
            Rdl.Render.FixedContainer rowBox = null;
            bool    visible = true;
            TextBox tb      = FindToggleItem(_visibility);

            if (_visibility != null && _visibility.IsHidden(context) && _visibility.ToggleItem == null)
            {
                visible = false;
            }
            if (box != null && visible)
            {
                rowBox        = box.AddFixedContainer(this, Style, context);
                rowBox.Name   = "TableRow";
                rowBox.Width  = box.Width;
                rowBox.Height = _height.points;

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

            foreach (Cell tc in _tableCells)
            {
                tc.Render(rowBox, context, ref cellPos);
            }
        }
Exemple #8
0
        internal override void Render(Rdl.Render.Container box, Rdl.Runtime.Context context)
        {
            Rdl.Render.FlowContainer rowBox = null;
            if (box != null)
            {
                rowBox                  = box.AddFlowContainer(this, Style, context, Rdl.Render.FlowContainer.FlowDirectionEnum.LeftToRight);
                rowBox.Name             = "RowBox";
                rowBox.MatchParentWidth = true;
                rowBox.Height           = Height.points;
            }

            int index = 0;

            foreach (Cell tc in _matrixCells)
            {
                Rdl.Render.FixedContainer cell = null;

                Matrix matrix = FindMatrix(this);

                if (rowBox != null)
                {
                    cell                    = rowBox.AddFixedContainer(this, Style, context);
                    cell.Name               = "MatrixCell";
                    cell.Height             = _height.points;
                    cell.Width              = matrix.Columns[index].Width;
                    cell.MatchParentHeight  = true;
                    cell.CanGrowHorizonally = false;
                }

                tc.Render(cell, context);

                index++;
            }
        }
        internal override void Render(Rdl.Render.Container box, Rdl.Runtime.Context context)
        {
            Rdl.Render.FixedContainer headerBox = box.AddFixedContainer(this, Style, context);
            headerBox.Name             = "Page" + _headerFooter.ToString();
            headerBox.Height           = _height.points;
            headerBox.MatchParentWidth = true;

            if (_reportItems != null)
            {
                _reportItems.Render(headerBox, context);
            }
        }
Exemple #10
0
        internal override void Render(Rdl.Render.Container box, Rdl.Runtime.Context context)
        {
            if (_staticRows.Count > FindMatrix(this).Rows.Count)
            {
                throw new Exception("There are more static row elements defined in matrix " + FindMatrix(this).Name + " than there are data rows.");
            }

            Rdl.Render.FlowContainer contentBox = null;
            if (box != null)
            {
                contentBox                   = box.AddFlowContainer(this, Style, context, Rdl.Render.FlowContainer.FlowDirectionEnum.TopDown);
                contentBox.Name              = "StaticRowContent";
                contentBox.Width             = Width.points;
                contentBox.MatchParentWidth  = true;
                contentBox.CanGrowVertically = true;
            }

            for (int i = 0; i < _staticRows.Count; i++)
            {
                Rdl.Render.FixedContainer cellBox = null;
                if (contentBox != null)
                {
                    cellBox                  = contentBox.AddFixedContainer(this, Style, context);
                    cellBox.Name             = "StaticRowCell";
                    cellBox.Height           = FindMatrix(this).Rows[i].Height.points;
                    cellBox.MatchParentWidth = true;
                }

                ReportItems item = _staticRows[i];

                item.Render(cellBox, context);
            }

            if (RenderNext != null)
            {
                if (RenderNext is ColumnGrouping)
                {
                    ((ColumnGrouping)RenderNext).Render(box, FindMatrix(this).Context, context, 0);
                }
                else
                {
                    RenderNext.Render(box, context);
                }
            }
        }
Exemple #11
0
        private void RenderSubtotal(Rdl.Render.Container box, Rdl.Runtime.Context context, bool hidden, TextBox tb)
        {
            Rdl.Render.FlowContainer totalBox = box.AddFlowContainer(this, Style, context, Rdl.Render.FlowContainer.FlowDirectionEnum.LeftToRight);
            totalBox.Name = "RowTotal";
            if (tb != null)
            {
                tb.LinkedToggles.Add(new Toggle(totalBox, tb, Enums.ToggleDirectionEnum.negative));
            }

            Rdl.Render.FixedContainer totalHeader = totalBox.AddFixedContainer(this, Style, context);
            totalHeader.Name              = "RowTotalHeader";
            totalHeader.Width             = TotalWidth;
            totalHeader.MatchParentHeight = true;
            //totalHeader.Height = FindMatrix(this).Rows.Height;
            totalHeader.CanGrowHorizonally = false;

            if (_subtotal != null)
            {
                _subtotal.ReportItems.Render(totalHeader, context);
            }

            // Render the details.
            MatrixElement m = RenderNext;

            while (m is RowGrouping)
            {
                m = ((RowGrouping)m).RenderNext;
            }

            if (m is ColumnGrouping)
            {
                ((ColumnGrouping)m).Render(totalBox, FindMatrix(this).Context, context, 0);
            }
            else
            {
                m.Render(totalBox, context);
            }
        }
Exemple #12
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();
                }
            }
        }
Exemple #13
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);
                }
            }
        }
Exemple #14
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);
        }
Exemple #15
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);
        }