Beispiel #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;
            }
        }
Beispiel #2
0
        public override object Execute(object p_args)
        {
            ContainHeadOrFootCmdArgs args = (ContainHeadOrFootCmdArgs)p_args;
            RptTblPart part = null;

            if (args.Flag == "Header")
            {
                part = new RptTblHeader(args.Table);
            }
            else
            {
                part = new RptTblFooter(args.Table);
            }
            RptTblPartRow row = new RptTblPartRow(part);

            InsertTableCmd.BuildCells(row, args.Table.ColSpan);
            part.Rows.Add(row);
            if (args.Flag == "Header")
            {
                args.Table.Header = (RptTblHeader)part;
            }
            else
            {
                args.Table.Footer = (RptTblFooter)part;
            }
            args.Table.CalcRowSpan();
            args.Table.Update(false);
            return(null);
        }
Beispiel #3
0
        public override void Undo(object p_args)
        {
            RemoveHeadOrFootCmdArgs args = (RemoveHeadOrFootCmdArgs)p_args;
            RptTblPart part = null;

            if (args.Flag == "Header")
            {
                part = new RptTblHeader(args.Table);
            }
            else
            {
                part = new RptTblFooter(args.Table);
            }
            foreach (RptTblPartRow row in args.Rows)
            {
                part.Rows.Add(row);
            }
            if (args.Flag == "Header")
            {
                args.Table.Header = (RptTblHeader)part;
            }
            else
            {
                args.Table.Footer = (RptTblFooter)part;
            }
            args.Table.CalcRowSpan();
            args.Table.Update(false);
        }
Beispiel #4
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;
                    }
                }
            }
        }