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); }
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"); } }
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); }
void RemoveCells(RptTblPart p_part, int p_index) { if (p_part != null) { foreach (RptTblPartRow r in p_part.Rows) { r.Cells.RemoveAt(p_index); } } }
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); } } }
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); } } }
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); } } }
public InsertTblRowCmdArgs(RptTblPart p_part, int p_index) { Part = p_part; Index = p_index; }
public RptTblPartRow(RptTblPart p_part) { TblPart = p_part; Cells = new List <RptText>(); }