public override object Execute(object p_args) { InsertCmdArgs args = (InsertCmdArgs)p_args; RptChart chart = args.RptItem as RptChart; CellRange range = args.CellRange; chart.Row = range.Row; chart.Col = range.Column; chart.RowSpan = range.RowCount; chart.ColSpan = range.ColumnCount; chart.Part.Items.Add(chart); return(chart); }
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); }
public override object Execute(object p_args) { InsertCmdArgs args = (InsertCmdArgs)p_args; RptText txt = args.RptItem as RptText; CellRange range = args.CellRange; txt.Row = range.Row; txt.Col = range.Column; txt.RowSpan = range.RowCount; txt.ColSpan = range.ColumnCount; txt.Val = "文本"; txt.LeftStyle = BorderLineStyle.None; txt.TopStyle = BorderLineStyle.None; txt.RightStyle = BorderLineStyle.None; txt.BottomStyle = BorderLineStyle.None; txt.Part.Items.Add(txt); return(txt); }
public override object Execute(object p_args) { InsertCmdArgs args = (InsertCmdArgs)p_args; RptTable tbl = args.RptItem as RptTable; RptPart con = tbl.Part; //通过重做重新加载table,不用处理 if (tbl.Header != null || tbl.Body != null || tbl.Footer != null) { con.Items.Add(tbl); return(tbl); } CellRange range = args.CellRange; tbl.Row = range.Row; tbl.Col = range.Column; tbl.RowSpan = range.RowCount; tbl.ColSpan = range.ColumnCount; RptTblPartRow tblRow; switch (tbl.RowSpan) { case 1: tbl.Body = new RptTblRow(tbl); tblRow = new RptTblPartRow(tbl.Body); tbl.Body.Rows.Add(tblRow); BuildCells(tblRow, tbl.ColSpan); break; case 2: tbl.Header = new RptTblHeader(tbl); tblRow = new RptTblPartRow(tbl.Header); tbl.Header.Rows.Add(tblRow); BuildCells(tblRow, tbl.ColSpan); tbl.Body = new RptTblRow(tbl); tblRow = new RptTblPartRow(tbl.Body); tbl.Body.Rows.Add(tblRow); BuildCells(tblRow, tbl.ColSpan); break; default: tbl.Header = new RptTblHeader(tbl); tblRow = new RptTblPartRow(tbl.Header); tbl.Header.Rows.Add(tblRow); BuildCells(tblRow, tbl.ColSpan); tbl.Body = new RptTblRow(tbl); for (int i = 0; i < tbl.RowSpan - 2; i++) { tblRow = new RptTblPartRow(tbl.Body); tbl.Body.Rows.Add(tblRow); BuildCells(tblRow, tbl.ColSpan); } tbl.Footer = new RptTblFooter(tbl); tblRow = new RptTblPartRow(tbl.Footer); tbl.Footer.Rows.Add(tblRow); BuildCells(tblRow, tbl.ColSpan); break; } con.Items.Add(tbl); return(tbl); }