List <ReportItem> _Items;                                       // list of report items

        internal ReportItems(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            ReportItem ri;

            _Items = new List <ReportItem>();

            // Loop thru all the child nodes
            foreach (XmlNode xNodeLoop in xNode.ChildNodes)
            {
                if (xNodeLoop.NodeType != XmlNodeType.Element)
                {
                    continue;
                }
                switch (xNodeLoop.Name)
                {
                case "Rectangle":
                    ri = new Rectangle(r, this, xNodeLoop);
                    break;

                case "Line":
                    ri = new Line(r, this, xNodeLoop);
                    break;

                case "Textbox":
                    ri = new Textbox(r, this, xNodeLoop);
                    break;

                case "Image":
                    ri = new Image(r, this, xNodeLoop);
                    break;

                case "Subreport":
                    ri = new Subreport(r, this, xNodeLoop);
                    break;

                // DataRegions: list, table, matrix, chart
                case "List":
                    ri = new List(r, this, xNodeLoop);
                    break;

                case "Table":
                case "Grid":
                case "fyi:Grid":
                    ri = new Table(r, this, xNodeLoop);
                    break;

                case "Matrix":
                    ri = new Matrix(r, this, xNodeLoop);
                    break;

                case "Chart":
                    ri = new Chart(r, this, xNodeLoop);
                    break;

                case "ChartExpression":                                 // For internal use only
                    ri = new ChartExpression(r, this, xNodeLoop);
                    break;

                case "CustomReportItem":
                    ri = new CustomReportItem(r, this, xNodeLoop);
                    break;

                default:
                    ri = null;                                          // don't know what this is
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown ReportItems element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
                if (ri != null)
                {
                    _Items.Add(ri);
                }
            }
            if (_Items.Count == 0)
            {
                OwnerReport.rl.LogError(8, "At least one item must be in the ReportItems.");
            }
            else
            {
                _Items.TrimExcess();
            }
        }
        List<ReportItem> _Items; // list of report items

        #endregion Fields

        #region Constructors

        internal ReportItems(ReportDefn r, ReportLink p, XmlNode xNode)
            : base(r, p)
        {
            ReportItem ri;
            _Items = new List<ReportItem>();

            // Loop thru all the child nodes
            foreach(XmlNode xNodeLoop in xNode.ChildNodes)
            {
                if (xNodeLoop.NodeType != XmlNodeType.Element)
                    continue;
                switch (xNodeLoop.Name)
                {
                    case "Rectangle":
                        ri = new Rectangle(r, this, xNodeLoop);
                        break;
                    case "Line":
                        ri = new Line(r, this, xNodeLoop);
                        break;
                    case "Textbox":
                        ri = new Textbox(r, this, xNodeLoop);
                        break;
                    case "Image":
                        ri = new Image(r, this, xNodeLoop);
                        break;
                    case "Subreport":
                        ri = new Subreport(r, this, xNodeLoop);
                        break;
                    // DataRegions: list, table, matrix, chart
                    case "List":
                        ri = new List(r, this, xNodeLoop);
                        break;
                    case "Table":
                    case "Grid":
                    case "fyi:Grid":
                        ri = new Table(r, this, xNodeLoop);
                        break;
                    case "Matrix":
                        ri = new Matrix(r, this, xNodeLoop);
                        break;
                    case "Chart":
                        ri = new Chart(r, this, xNodeLoop);
                        break;
                    case "ChartExpression":		// For internal use only
                        ri = new ChartExpression(r, this, xNodeLoop);
                        break;
                    case "CustomReportItem":
                        ri = new CustomReportItem(r, this, xNodeLoop);
                        break;
                    default:
                        ri=null;		// don't know what this is
                        // don't know this element - log it
                        OwnerReport.rl.LogError(4, "Unknown ReportItems element '" + xNodeLoop.Name + "' ignored.");
                        break;
                }
                if (ri != null)
                {
                    _Items.Add(ri);
                }
            }
            if (_Items.Count == 0)
                OwnerReport.rl.LogError(8, "At least one item must be in the ReportItems.");
            else
                _Items.TrimExcess();
        }