请参考如下代码
- this.FpSpread1.ActiveSheetView.ColumnFooter.Visible = true;
- this.FpSpread1.ActiveSheetView.ColumnFooter.RowCount = 2;
- this.FpSpread1.ActiveSheetView.ColumnFooter.DefaultStyle.Border.BorderStyle = BorderStyle.Double;
- this.FpSpread1.ActiveSheetView.ColumnFooter.Columns[12].HorizontalAlign = HorizontalAlign.Left;
- this.FpSpread1.ActiveSheetView.ColumnFooter.Cells[0, 12].RowSpan = 2;
- //Value
- for (int r = 0; r < this.FpSpread1.ActiveSheetView.RowCount; r++)
- {
- for (int j = 0; j < this.FpSpread1.ActiveSheetView.ColumnCount; j++)
- {
- FpSpread1.ActiveSheetView.DataModel.SetValue(r, j, j + r * FpSpread1.ActiveSheetView.ColumnCount);
- }
- }
- int i = 0;
- this.FpSpread1.ActiveSheetView.Columns[i].AggregationType = FarPoint.Web.Spread.Model.AggregationType.Sum;
- this.FpSpread1.ActiveSheetView.ColumnFooter.Cells[0, i].Value = "Sum";
- this.FpSpread1.ActiveSheetView.ColumnFooter.Cells[1, i].Value = "Sum:[{0}]";
复制代码 |