Esempio n. 1
0
        protected override void ReadChildXml(XmlReader p_reader)
        {
            switch (p_reader.Name)
            {
            case "THeader":
                Header = new RptTblHeader(this);
                Header.ReadXml(p_reader);
                break;

            case "TBody":
                Body = new RptTblRow(this);
                Body.ReadXml(p_reader);
                break;

            case "TFooter":
                Footer = new RptTblFooter(this);
                Footer.ReadXml(p_reader);
                break;

            case "TGroup":
                if (Groups == null)
                {
                    Groups = new List <RptTblGroup>();
                }
                RptTblGroup group = new RptTblGroup(this);
                group.ReadXml(p_reader);
                Groups.Add(group);
                break;

            default:
                break;
            }
        }
Esempio n. 2
0
        void CopyTableStruct(RptTable p_source, RptTable p_dest)
        {
            int           rowCount = 0;
            RptTblPartRow tmpRow   = null;

            if (p_source.Header != null && (rowCount = p_source.Header.Rows.Count) > 0)
            {
                RptTblHeader header = new RptTblHeader(p_dest);
                for (int i = 0; i < rowCount; i++)
                {
                    tmpRow = new RptTblPartRow(header);
                    header.Rows.Add(CopyTableRow(this.Header.Rows[i], tmpRow));
                }
                p_dest.Header = header;
            }

            if (p_source.Body != null && (rowCount = p_source.Body.Rows.Count) > 0)
            {
                RptTblRow body = new RptTblRow(p_dest);
                for (int i = 0; i < rowCount; i++)
                {
                    tmpRow = new RptTblPartRow(body);
                    body.Rows.Add(CopyTableRow(this.Body.Rows[i], tmpRow));
                }
                p_dest.Body = body;
            }

            if (p_source.Footer != null && (rowCount = p_source.Footer.Rows.Count) > 0)
            {
                RptTblFooter foot = new RptTblFooter(p_dest);
                for (int i = 0; i < rowCount; i++)
                {
                    tmpRow = new RptTblPartRow(foot);
                    foot.Rows.Add(CopyTableRow(this.Footer.Rows[i], tmpRow));
                }
                p_dest.Footer = foot;
            }

            int grpCount = 0;

            if (p_source.Groups != null && (grpCount = p_source.Groups.Count) > 0)
            {
                RptTblGroup       grp          = null;
                RptTblGroupHeader grpHeader    = null;
                RptTblGroupFooter grpFooter    = null;
                RptTblGroup       newGrp       = null;
                RptTblGroupHeader newGrpHeader = null;
                RptTblGroupFooter newGrpFooter = null;
                if (p_dest.Groups == null)
                {
                    p_dest.Groups = new List <RptTblGroup>();
                }

                for (int j = 0; j < grpCount; j++)
                {
                    grp    = p_source.Groups[j];
                    newGrp = new RptTblGroup(p_dest);
                    p_dest.Groups.Add(newGrp);
                    newGrp.Field = grp.Field;
                    if ((grpHeader = grp.Header) != null && (rowCount = grpHeader.Rows.Count) > 0)
                    {
                        newGrpHeader = new RptTblGroupHeader(p_dest);
                        for (int i = 0; i < rowCount; i++)
                        {
                            tmpRow = new RptTblPartRow(newGrpHeader);
                            newGrpHeader.Rows.Add(CopyTableRow(grpHeader.Rows[i], tmpRow));
                        }
                        newGrp.Header = newGrpHeader;
                    }

                    if ((grpFooter = grp.Footer) != null && (rowCount = grpFooter.Rows.Count) > 0)
                    {
                        newGrpFooter = new RptTblGroupFooter(p_dest);
                        for (int i = 0; i < rowCount; i++)
                        {
                            tmpRow = new RptTblPartRow(grpFooter);
                            newGrpFooter.Rows.Add(CopyTableRow(grpFooter.Rows[i], tmpRow));
                        }
                        newGrp.Footer = newGrpFooter;
                    }
                }
            }
        }