示例#1
0
        internal new Rdl.Render.GenericRender Render(Rdl.Render.Container box, Rdl.Runtime.Context parentContext)
        {
            Rdl.Runtime.Context context = new Rdl.Runtime.Context(
                parentContext,
                null,
                null,
                null,
                null);

            // Initialize the data sets. // Initialized in RunTimeBase
            //_dataSets.Initialize();
            _dataSets.Reset();

            // Set the default DataSet for the report
            if (_dataSchema != null)
            {
                _reportDataSet = _dataSets[_dataSchema];
            }
            else
            {
                _reportDataSet = _dataSets.FirstDataSet;
            }

            // Set up the default data context.
            if (parentContext != null)
            {
                parentContext = parentContext.FindContextByDS(_reportDataSet);
            }
            context = new Rdl.Runtime.Context(
                parentContext, _reportDataSet, null, null, null);

            Rdl.Render.GenericRender render;
            if (box == null)
            {
                render = new Rdl.Render.GenericRender(this, context);
                box    = render.BodyContainer;
            }
            else
            {
                render = box.Render;
            }

            if (_pageHeader != null)
            {
                _pageHeader.Render(render.PageHeaderContainer, context);
            }

            if (_pageFooter != null)
            {
                _pageFooter.Render(render.PageFooterContainer, context);
            }

            // Render the report.
            _body.Render(box, context);

            context.LinkToggles();

            return(render);
        }
示例#2
0
        protected override void Render1(Rdl.Render.Container parentBox, Rdl.Runtime.Context context, bool visible)
        {
            _text = string.Empty;
            // Link the textboxes occuring at the current context level.
            context.TextBoxes[Name] = this;

            try
            {
                object o = _vaue.Exec(context);
                if (!Convert.IsDBNull(o))
                {
                    if (Style != null && Style.Format(context) != string.Empty)
                    {
                        _text = String.Format("{0:" + Style.Format(context) + "}", o);
                    }
                    else
                    {
                        _text = o.ToString();
                    }
                }
            }
            catch (Exception err)
            {
                throw new Exception("Error evaluating expression in TextBox " + _name, err);
            }
            bool hidden = false;

            if (_hideDuplicates != null)
            {
                int gi = context.FindContextByGroupName(_hideDuplicates, this.Report).GroupIndex;
                if (_text == _lastValue)
                {
                    if (gi == _lastGroupIndex)
                    {
                        hidden = true;
                    }
                }
                _lastGroupIndex = gi;
            }

            if (visible && parentBox != null)
            {
                _box      = parentBox.AddTextElement(this, _name, (hidden)?string.Empty:_text, Style, context);
                _box.Name = "TextBox";
                //TextElement = (Rdl.Render.TextElement)_box;
            }

            _lastValue = _text;
        }
示例#3
0
        internal override void Render(Rdl.Render.Container box, Rdl.Runtime.Context context)
        {
            bool visible = true;

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

            Render1(box, context, visible);

            if (_action != null)
            {
                _action.Render(box, context);
            }

            if (_box != null && visible)
            {
                if (IsInCell)
                {
                    _box.MatchParentHeight = true;
                    _box.MatchParentWidth  = true;
                    // Cell widths don't change.
                    _box.Width  = _box.Parent.Width;
                    _box.Height = _box.Parent.Height;
                }
                else
                {
                    _box.Top    = _top.points;
                    _box.Left   = _left.points;
                    _box.Width  = (_width == null) ? box.Width - _left.points : _width.points;
                    _box.Height = (_height == null) ? box.Height - _top.points : _height.points;
                }
            }

            Render2(context);

            TextBox tb = Report.FindToggleItem(_visibility);

            if (tb != null)
            {
                tb.LinkedToggles.Add(new Toggle(_box, tb));
            }
        }
示例#4
0
 // For ReportItems rendering is broken into 2 parts.  The first part generates
 // the contianing box and the second part is called after.  This allows
 // for base type operations to be performed on the containing box.
 protected abstract void Render1(Rdl.Render.Container parentBox, Rdl.Runtime.Context context, bool visible);