Пример #1
0
        public Container(Container b, bool copyChildren)
            : this(b)
        {
            if (copyChildren)
            {
                foreach (Element e in b._childElements)
                {
                    Element newElement = null;
                    if (e is FixedContainer)
                    {
                        newElement = new FixedContainer((FixedContainer)e, true);
                    }
                    if (e is FlowContainer)
                    {
                        newElement = new FlowContainer((FlowContainer)e, true);
                    }
                    if (e is TextElement)
                    {
                        newElement = new TextElement((TextElement)e);
                    }
                    if (e is ImageElement)
                    {
                        newElement = new ImageElement((ImageElement)e);
                    }
                    if (e is ChartElement)
                    {
                        newElement = new ChartElement((ChartElement)e);
                    }

                    newElement.Parent = this;
                    _childElements.Add(newElement);
                }
            }
        }
Пример #2
0
        internal FixedContainer AddFixedContainer(Rdl.Engine.ReportElement reportElement, Rdl.Engine.Style style, Rdl.Runtime.Context context)
        {
            FixedContainer child = new FixedContainer(this, reportElement, new BoxStyle(style, context));

            _childElements.Add(child);
            if (style != null && style.BackgroundImage != null)
            {
                _imageIndex = Render.AddImage(style.BackgroundImage, context);
            }
            return(child);
        }
Пример #3
0
        internal Page(Rdl.Render.GenericRender rpt,
                      int pageNumber,
                      decimal width,
                      decimal height,
                      decimal relativeTop,
                      Container breakAt,
                      ref Container currentPos) : base(null, null, null)
        {
            Width             = width;
            Height            = height;
            CanGrowVertically = false;
            Name           = "Page";
            _pageNumber    = pageNumber;
            _relativeTop   = relativeTop;
            _genericRender = rpt;

            _pageHeaderBox                   = AddFixedContainer(rpt.Report, rpt.Report.Style, null);
            _pageHeaderBox.Width             = Width;
            _pageHeaderBox.Name              = "PageHeader";
            _pageHeaderBox.CanGrowVertically = true;

            // Add in the page header if appropriate
            if (rpt.Report.PageHeader != null)
            {
                if (pageNumber > 0 || rpt.Report.PageHeader.PrintOnFirstPage)
                {
                    _pageHeaderBox.Children.Add(PageRender.Copy(rpt.PageHeaderContainer, true));
                }
            }
            _pageHeaderBox.SetSizes(false);

            _pageDetailsBox                   = AddFixedContainer(rpt.Report, rpt.Report.Style, null);
            _pageDetailsBox.Width             = Width;
            _pageDetailsBox.Height            = Height;
            _pageDetailsBox.Name              = "PageDetails";
            _pageDetailsBox.CanGrowVertically = false;

            _pageFooterBox                   = AddFixedContainer(rpt.Report, rpt.Report.Style, null);
            _pageFooterBox.Width             = Width;
            _pageFooterBox.Name              = "PageFooter";
            _pageFooterBox.CanGrowVertically = true;

            if (breakAt != null)
            {
                AddHeaders(breakAt);
            }
            AddFooters(rpt, _pageFooterBox);

            _pageDetailsBox.Height = Height - _pageHeaderBox.Height - _pageFooterBox.Height;
            _pageDetailsBox.Top    = _pageHeaderBox.Height;

            currentPos = AddParentBoxes(breakAt, _pageDetailsBox);
        }