Exemple #1
0
        protected override void ReadChildXml(XmlReader p_reader)
        {
            switch (p_reader.Name)
            {
            case "Corner":
                Corner = new RptMtxCorner(this);
                Corner.ReadXml(p_reader);
                break;

            case "RowHeader":
                RowHeader = new RptMtxRowHeader(this);
                RowHeader.ReadXml(p_reader);
                break;

            case "ColHeader":
                ColHeader = new RptMtxColHeader(this);
                ColHeader.ReadXml(p_reader);
                break;

            case "MRow":
                if (Rows == null)
                {
                    Rows = new List <RptMtxRow>();
                }
                RptMtxRow row = new RptMtxRow(this);
                row.ReadXml(p_reader);
                Rows.Add(row);
                break;

            default:
                break;
            }
        }
Exemple #2
0
        /// <summary>
        /// 克隆列头
        /// </summary>
        /// <param name="p_mtx"></param>
        /// <returns></returns>
        public RptMtxColHeader Clone(RptMatrix p_mtx)
        {
            RptMtxColHeader header = new RptMtxColHeader(p_mtx);

            foreach (RptMtxLevel level in Levels)
            {
                header.Levels.Add(level.Clone(header));
            }
            return(header);
        }
Exemple #3
0
        public override object Execute(object p_args)
        {
            InsertCmdArgs args = (InsertCmdArgs)p_args;
            RptMatrix     mat  = args.RptItem as RptMatrix;
            RptPart       con  = mat.Part;

            // 是通过重做来执行的,直接返回对象。
            if (mat.RowHeader != null || mat.ColHeader != null)
            {
                con.Items.Add(mat);
                return(mat);
            }

            CellRange range = args.CellRange;

            mat.Row     = range.Row;
            mat.Col     = range.Column;
            mat.RowSpan = range.RowCount;
            mat.ColSpan = range.ColumnCount;
            mat.Corner  = new RptMtxCorner(mat);
            RptMtxRowHeader rowheader = new RptMtxRowHeader(mat);

            mat.RowHeader = rowheader;
            RptMtxLevel level2 = new RptMtxLevel(rowheader);

            level2.Item.Val = "level2";
            rowheader.Levels.Add(level2);

            RptMtxColHeader colheader = new RptMtxColHeader(mat);

            mat.ColHeader = colheader;
            RptMtxLevel level1 = new RptMtxLevel(colheader);

            level1.Item.Val = "level1";
            colheader.Levels.Add(level1);

            RptMtxRow row = new RptMtxRow(mat);

            row.Cells.Add(new RptText(row)
            {
                Val = "cell0"
            });
            mat.Rows.Add(row);
            con.Items.Add(mat);
            return(mat);
        }