Exemple #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;
            }
        }
Exemple #2
0
        void OnInsertGrpClick(object sender, RoutedEventArgs e)
        {
            // 先测试扩展位置是否与其他控件冲突
            if (_table.TestIncIntersect(2))
            {
                Kit.Warn("增加行后与已有控件位置发生重叠,请调整控件位置后重试!");
                return;
            }

            RptTblGroup grp = new RptTblGroup(_table);

            grp.Header = new RptTblGroupHeader(_table);
            grp.Footer = new RptTblGroupFooter(_table);
            _info.ExecuteCmd(RptCmds.InsertTblGrp, new InsertTblGrpCmdArgs(_table, grp));
        }
Exemple #3
0
 void InsertTblCells(RptTable p_table, int p_index, Dictionary <string, RptText> p_dict)
 {
     InsertCells(p_table.Header, p_index, p_dict, "header");
     if (p_table.Groups != null && p_table.Groups.Count > 0)
     {
         for (int i = 0; i < p_table.Groups.Count; i++)
         {
             RptTblGroup grp = p_table.Groups[i];
             InsertCells(grp.Header, p_index, p_dict, "grpHeader" + i.ToString());
             InsertCells(grp.Footer, p_index, p_dict, "grpFooter" + i.ToString());
         }
     }
     InsertCells(p_table.Body, p_index, p_dict, "body");
     InsertCells(p_table.Footer, p_index, p_dict, "footer");
 }
Exemple #4
0
 public InsertTblGrpCmdArgs(RptTable p_table, RptTblGroup p_grp)
 {
     Table = p_table;
     Grp   = p_grp;
 }
Exemple #5
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;
                    }
                }
            }
        }