Exemple #1
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);
        }
Exemple #2
0
        internal void LoadItem(RptText p_item, bool p_isGroup)
        {
            _txt     = p_item;
            _curRow  = p_item.Parent as RptTblPartRow;
            _part    = _curRow.Parent as RptTblPart;
            _table   = _part.Table;
            _fv.Data = _table.Data;

            UpdateHeaderFooterState();
            if (p_isGroup)
            {
                _fvGrp.Show("field");
                foreach (RptTblGroup grp in _table.Groups)
                {
                    if (grp.Header == _part || grp.Footer == _part)
                    {
                        _fvGrp.Data = grp.Data;
                        break;
                    }
                }
            }
            else
            {
                _fvGrp.Hide("field");
            }
        }
Exemple #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);
        }
Exemple #4
0
 void RemoveCells(RptTblPart p_part, int p_index)
 {
     if (p_part != null)
     {
         foreach (RptTblPartRow r in p_part.Rows)
         {
             r.Cells.RemoveAt(p_index);
         }
     }
 }
Exemple #5
0
 void InsertCells(RptTblPart p_part, int p_index, Dictionary <string, RptText> p_dict, string p_pre)
 {
     if (p_part != null)
     {
         for (int i = 0; i < p_part.Rows.Count; i++)
         {
             RptText text = p_dict[p_pre + i.ToString()];
             p_part.Rows[i].Cells.Insert(p_index, text);
         }
     }
 }
Exemple #6
0
 void RemoveCells(RptTblPart p_part, int p_index, Dictionary <string, RptText> p_dict, string p_pre)
 {
     if (p_part != null)
     {
         for (int i = 0; i < p_part.Rows.Count; i++)
         {
             RptText text = p_part.Rows[i].Cells[p_index];
             p_dict.Add(p_pre + i.ToString(), text);
             p_part.Rows[i].Cells.RemoveAt(p_index);
         }
     }
 }
Exemple #7
0
 void BuildCells(RptTblPart p_part, int p_index)
 {
     if (p_part != null)
     {
         foreach (RptTblPartRow r in p_part.Rows)
         {
             RptText txt = new RptText(r);
             txt.Row     = r.Row;
             txt.RowSpan = 1;
             txt.Col     = p_index;
             txt.ColSpan = 1;
             r.Cells.Insert(p_index, txt);
         }
     }
 }
Exemple #8
0
 public InsertTblRowCmdArgs(RptTblPart p_part, int p_index)
 {
     Part  = p_part;
     Index = p_index;
 }
Exemple #9
0
 public RptTblPartRow(RptTblPart p_part)
 {
     TblPart = p_part;
     Cells   = new List <RptText>();
 }