Beispiel #1
0
        List <SubreportParameter> _Items;                        // list of SubreportParameter

        internal SubReportParameters(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            SubreportParameter rp;

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

                default:
                    rp = null;                                          // don't know what this is
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown SubreportParameters element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
                if (rp != null)
                {
                    _Items.Add(rp);
                }
            }
            if (_Items.Count > 0)
            {
                _Items.TrimExcess();
            }
        }
        List<SubreportParameter> _Items; // list of SubreportParameter

        #endregion Fields

        #region Constructors

        internal SubReportParameters(ReportDefn r, ReportLink p, XmlNode xNode)
            : base(r, p)
        {
            SubreportParameter rp;
            _Items = new List<SubreportParameter>();
            // Loop thru all the child nodes
            foreach(XmlNode xNodeLoop in xNode.ChildNodes)
            {
                if (xNodeLoop.NodeType != XmlNodeType.Element)
                    continue;
                switch (xNodeLoop.Name)
                {
                    case "Parameter":
                        rp = new SubreportParameter(r, this, xNodeLoop);
                        break;
                    default:
                        rp=null;		// don't know what this is
                        // don't know this element - log it
                        OwnerReport.rl.LogError(4, "Unknown SubreportParameters element '" + xNodeLoop.Name + "' ignored.");
                        break;
                }
                if (rp != null)
                    _Items.Add(rp);
            }
            if (_Items.Count > 0)
                _Items.TrimExcess();
        }