曾经尝试过这种做法,但是没有任何合并的效果出现,下面的我的测试代码
FpSpread1.ActiveSheetView.ColumnHeader.Columns.Count = 16;
FpSpread1.ActiveSheetView.LayoutMode = FarPoint.Web.Spread.SheetView.LayoutModeType.RowTemplateLayoutMode;
FpSpread1.ActiveSheetView.RowTemplate.ColumnCount = FpSpread1.ActiveSheetView.ColumnCount;
FpSpread1.ActiveSheetView.RowTemplate.RowCount = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 0].ColumnSpan = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 0].LayoutColumn.Width = 15;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 0].LayoutRow.Height = 15;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 0].DataIndex = 0;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 0].RowSpan = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 1].DataIndex = 1;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 1].RowSpan = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 2].DataIndex = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 2].RowSpan = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 3].DataIndex = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 3].RowSpan = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 4].DataIndex = 14;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 5].DataIndex = 3;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[1, 4].DataIndex = 4;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[1, 4].ColumnSpan = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 6].DataIndex = 14;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 7].DataIndex = 5;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[1, 6].DataIndex = 4;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[1, 6].ColumnSpan = 6;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 8].DataIndex = 7;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 8].RowSpan = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 9].DataIndex = 14;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[1, 9].DataIndex = 8;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 10].DataIndex = 9;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 10].RowSpan = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 11].DataIndex = 14;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 11].RowSpan = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 12].DataIndex = 10;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 12].RowSpan = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 13].DataIndex = 11;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 13].RowSpan = 2;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 14].DataIndex = 14;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[0, 15].DataIndex = 12;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[1, 14].DataIndex = 13;
FpSpread1.ActiveSheetView.RowTemplate.LayoutCells[1, 14].ColumnSpan = 2;
FpSpread1.ActiveSheetView.DataSource = ds.Tables[0]; |