コード例 #1
0
        /// <summary>
        /// Generates an TableCell from its RDL representation.
        /// </summary>
        /// <param name="reader">The <typeparamref name="XmlReader"/> stream from which the TableCell is deserialized</param>
        public void ReadXml(XmlReader reader)
        {
            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.EndElement && reader.Name == Rdl.TABLECELL)
                {
                    break;
                }
                else if (reader.NodeType == XmlNodeType.Element)
                {
                    //--- ReportItems
                    if (reader.Name == Rdl.REPORTITEMS)
                    {
                        if (_reportItems == null)
                        {
                            _reportItems = new ReportItemCollection();
                        }

                        ((IXmlSerializable)_reportItems).ReadXml(reader);
                    }

                    //--- ColSpan
                    if (reader.Name == Rdl.COLSPAN)
                    {
                        _colSpan = int.Parse(reader.ReadString());
                    }
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Generates an Body from its RDL representation.
        /// </summary>
        /// <param name="reader">The <typeparamref name="XmlReader"/> stream from which the Body is deserialized</param>
        public void ReadXml(System.Xml.XmlReader reader)
        {
            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.EndElement && reader.Name == Rdl.BODY)
                {
                    break;
                }
                else if (reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement)
                {
                    //--- Report Items
                    if (reader.Name == Rdl.REPORTITEMS && !reader.IsEmptyElement)
                    {
                        if (_reportItems == null)
                        {
                            _reportItems = new ReportItemCollection();
                        }

                        ((IXmlSerializable)_reportItems).ReadXml(reader);
                    }

                    //--- Height
                    if (reader.Name == Rdl.HEIGHT)
                    {
                        _height = Size.Parse(reader.ReadString());
                    }

                    //--- Columns
                    if (reader.Name == Rdl.COLUMNS)
                    {
                        _columns = int.Parse(reader.ReadString());
                    }

                    //--- ColumnSpacing
                    if (reader.Name == Rdl.COLUMNSPACING)
                    {
                        _columnSpacing = Size.Parse(reader.ReadString());
                    }

                    //--- Style
                    if (reader.Name == Rdl.STYLE && !reader.IsEmptyElement)
                    {
                        if (_style == null)
                        {
                            _style = new Style();
                        }

                        ((IXmlSerializable)_style).ReadXml(reader);
                    }
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// Generates an PageHeader from its RDL representation.
        /// </summary>
        /// <param name="reader">The <typeparamref name="XmlReader"/> stream from which the PageHeader is deserialized</param>
        public void ReadXml(XmlReader reader)
        {
            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.EndElement && reader.Name == Rdl.PAGEHEADER)
                {
                    break;
                }
                else if (reader.NodeType == XmlNodeType.Element)
                {
                    //--- Height
                    if (reader.Name == Rdl.HEIGHT)
                    {
                        _height = Size.Parse(reader.ReadString());
                    }

                    //--- PrintOnFirstPage
                    if (reader.Name == Rdl.PRINTONFIRSTPAGE)
                    {
                        _printOnFirstPage = bool.Parse(reader.ReadString());
                    }

                    //--- PrintOnLastPage
                    if (reader.Name == Rdl.PRINTONLASTPAGE)
                    {
                        _printOnLastPage = bool.Parse(reader.ReadString());
                    }

                    //--- Report Items
                    if (reader.Name == Rdl.REPORTITEMS && !reader.IsEmptyElement)
                    {
                        if (_reportItems == null)
                        {
                            _reportItems = new ReportItemCollection();
                        }

                        ((IXmlSerializable)_reportItems).ReadXml(reader);
                    }

                    //--- Style
                    if (reader.Name == Rdl.STYLE && !reader.IsEmptyElement)
                    {
                        if (_style == null)
                        {
                            _style = new Style();
                        }

                        ((IXmlSerializable)_style).ReadXml(reader);
                    }
                }
            }
        }
コード例 #4
0
        protected override void ReadRDL(XmlReader reader)
        {
            switch (reader.Name)
            {
            case Rdl.PAGEBREAKATSTART:  _pageBreakAtStart = bool.Parse(reader.ReadString()); break;

            case Rdl.PAGEBREAKATEND:    _pageBreakAtEnd = bool.Parse(reader.ReadString()); break;

            case PREFERRED_HEIGHT:      _preferredHeight = Size.Parse(reader.ReadString()); break;

            case Rdl.REPORTITEMS:       if (!reader.IsEmptyElement)
                {
                    if (_reportItems == null)
                    {
                        _reportItems = new ReportItemCollection();
                    }
                    ((IXmlSerializable)_reportItems).ReadXml(reader);
                }
                break;
            }
        }