fpSpread1.Sheets(0).RowCount = 8
fpSpread1.Sheets(0).ColumnCount = 15
fpSpread1.Sheets(0).GroupBarInfo.Visible = True
fpSpread1.Sheets(0).AllowGroup = True
fpSpread1.Sheets(0).GroupFooterVisible = True
fpSpread1.Sheets(0).ColumnFooter.Visible = True
fpSpread1.Sheets(0).ColumnFooter.RowCount = 2
fpSpread1.Sheets(0).ColumnFooter.Columns(12).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Left
'Value
Dim r As Integer
Dim j As Integer
For r = 0 To fpSpread1.Sheets(0).RowCount
For j = 0 To fpSpread1.Sheets(0).ColumnCount
fpSpread1.Sheets(0).Models.Data.SetValue(r, j, j + r * fpSpread1.Sheets(0).ColumnCount)
Next j
Next r
Dim i As Integer
i = 0
fpSpread1.Sheets(0).ColumnFooter.SetAggregationFormat(0, 1, "Sum:{0}")
fpSpread1.Sheets(0).ColumnFooter.SetAggregationType(0, 1, FarPoint.Win.Spread.Model.AggregationType.Sum)
fpSpread1.Sheets(0).Models.ColumnFooterRowAxis.SetResizable(1, True)
fpSpread1.Sheets(0).ColumnFooter.Cells(0, i).Value = "Sum"
Private Sub fpSpread1_Grouped(ByVal sender As Object, ByVal e As System.EventArgs) Handles fpSpread1.Grouped
Dim gdm As FarPoint.Win.Spread.Model.GroupDataModel
Dim g1 As FarPoint.Win.Spread.Model.Group
gdm = fpSpread1.Sheets(0).Models.Data
gdm.GroupFooterVisible = True
g1 = gdm.Groups(1)
CType(g1.GroupFooter.DataModel, FarPoint.Win.Spread.Model.IAggregationSupport).SetCellAggregationType(0, 0, FarPoint.Win.Spread.Model.AggregationType.Sum)
CType(g1.GroupFooter.DataModel, FarPoint.Win.Spread.Model.IAggregationSupport).SetCellAggregationFormat(0, 0, "Sum: {0}")
fpSpread1.ActiveSheet.Models.Data = gdm
End Sub