# Displaying a Footer for Columns or Groups

Learn how to display and customize column and group footers in Spread.NET with detailed API references and examples.

## Content

You can show a column footer, a group footer, or both for the sheet and put information in the footer such as formulas or text. The column footer is an area at the bottom of the sheet. The group footer is an extra row of footer cells at the bottom of a sheet with grouping, if you are using the grouping feature.
For details on the API, refer to the [ColumnFooter](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.ColumnFooter.html) property of the [SheetView](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.html) class and the various members of the [ColumnFooter](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.ColumnFooter.html) class.
To calculate the column footer or group footer result with a formula, set the [SetAggregationType](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.ColumnFooter.SetAggregationType.html) method of the ColumnFooter object to the correct formula type for that column. The following figure displays a group bar and a column footer with a formula in the column:
![Spread control with red grid lines](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/columnfooter.png)
The group footer is an extra row that is displayed below the group after grouping by a column header. The [GroupFooterVisible](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.GroupFooterVisible.html) property must be set to true after the group has been created. The [Grouped](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.Grouped.html) event can be used to put information in the group footer after a user has created the group.
For more information on grouping, refer to [Managing Grouping of Rows of User Data](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-interact-rowcol/spwin-grouping).

## Properties Window

1. At design time, in the **Properties** window, select the **Sheets** property for the FpSpread component.
2. Click the button to display the **SheetView Collection Editor**.
3. Select the **ColumnFooter** property or the **GroupFooter** property or both in the **Property** list and set **Visible** to true.
4. Click **OK** to close the editor.

## Using a Shortcut

Set the [Visible](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.ColumnFooter.Visible.html) property of the ColumnFooter for the sheet.
**Example**
This example code displays a column footer and sets a span and a text color.
**C#**

```csharp
fpSpread1.Sheets[0].RowCount = 10;
fpSpread1.Sheets[0].ColumnCount = 15;
// Show the column footer.
fpSpread1.Sheets[0].ColumnFooter.Visible = true;
fpSpread1.Sheets[0].ColumnFooter.RowCount = 2;
fpSpread1.Sheets[0].ColumnFooter.DefaultStyle.ForeColor = Color.Purple;
fpSpread1.Sheets[0].ColumnFooter.Columns[12].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Left;
fpSpread1.Sheets[0].ColumnFooter.Cells[0, 12].RowSpan = 2;
fpSpread1.Sheets[0].ColumnFooter.Cells[0, 0].Value = "test";
```

**VB**

```vbnet
fpSpread1.Sheets(0).RowCount = 10
fpSpread1.Sheets(0).ColumnCount = 15
' Show the footer.
fpSpread1.Sheets(0).ColumnFooter.Visible = true
fpSpread1.Sheets(0).ColumnFooter.RowCount = 2
fpSpread1.Sheets(0).ColumnFooter.DefaultStyle.ForeColor = Color.Purple
fpSpread1.Sheets(0).ColumnFooter.Columns(12).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Left
fpSpread1.Sheets(0).ColumnFooter.Cells(0, 12).RowSpan = 2
fpSpread1.Sheets(0).ColumnFooter.Cells(0, 0).Value = "test
```

## Method to set

1. Set the [Visible](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.ColumnFooter.Visible.html) property of the ColumnFooter for the sheet.
2. Set the **SetAggregationType** method for the column.

**Example**
This example sums the values in the first column and displays them in the column footer. The example also sums the values in the second group and puts them in the group footer.
**C#**

```csharp
private void Form1_Load(object sender, System.EventArgs e)
 {
 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;
 fpSpread1.Sheets[0].ColumnFooter.Cells[0, 12].RowSpan = 2;
 //Value
 for (int r = 0; r < fpSpread1.Sheets[0].RowCount; r++)
 {
 for (int j = 0; j < fpSpread1.Sheets[0].ColumnCount; j++)
 {
 fpSpread1.Sheets[0].Models.Data.SetValue(r, j, j + r * fpSpread1.Sheets[0].ColumnCount);
 }
 }
int i = 0;
 fpSpread1.Sheets[0].ColumnFooter.SetAggregationType(0,1, FarPoint.Win.Spread.Model.AggregationType.Sum);
 fpSpread1.Sheets[0].ColumnFooter.Cells[0, i].Value = "Sum";
 }
 private void fpSpread1_Grouped(object sender, EventArgs e)
 FarPoint.Win.Spread.Model.GroupDataModel gdm;
gdm = (FarPoint.Win.Spread.Model.GroupDataModel)fpSpread1.ActiveSheet.Models.Data;
 gdm.GroupFooterVisible = true;
 FarPoint.Win.Spread.Model.Group g1 = (FarPoint.Win.Spread.Model.Group)gdm.Groups[1];
 ((FarPoint.Win.Spread.Model.IAggregationSupport)g1.GroupFooter.DataModel).SetCellAggregationType(0, 0,
 FarPoint.Win.Spread.Model.AggregationType.Sum);
 fpSpread1.ActiveSheet.Models.Data = gdm;
 }
```

**VB**

```vbnet
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
 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.SetAggregationType(0, 1, FarPoint.Win.Spread.Model.AggregationType.Sum)
 fpSpread1.Sheets(0).ColumnFooter.Cells(0, i).Value = "Sum"
 End Sub
 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)
 fpSpread1.ActiveSheet.Models.Data = gdm
 End Sub
```

**Example**
This example code displays a column footer and adds a formula from a different sheet.
**C#**

```csharp
fpSpread1.Sheets.Count = 3;
 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;
 fpSpread1.Sheets[0].ColumnFooter.Cells[0, 12].RowSpan = 2;
 //Value
 for (int r = 0; r < fpSpread1.Sheets[0].RowCount; r++)
 {
     for (int j = 0; j < fpSpread1.Sheets[0].ColumnCount; j++)
     {
         fpSpread1.Sheets[0].Models.Data.SetValue(r, j, j + r * fpSpread1.Sheets[0].ColumnCount);
     }
 }
int i = 0;       
 fpSpread1.Sheets[1].RowCount = 10;
 fpSpread1.Sheets[1].ColumnCount = 15;
 fpSpread1.Sheets[1].GroupBarInfo.Visible = true;
 fpSpread1.Sheets[1].AllowGroup = true;
 fpSpread1.Sheets[1].GroupFooterVisible = true;
 fpSpread1.Sheets[1].ColumnFooter.Visible = true;
 fpSpread1.Sheets[1].ColumnFooter.RowCount = 2;
 fpSpread1.Sheets[1].ColumnFooter.Columns[12].HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Left;
 fpSpread1.Sheets[1].ColumnFooter.Cells[0, 12].RowSpan = 2;
 //Value
 for (int r = 0; r < fpSpread1.Sheets[1].RowCount; r++)
 {
     for (int j = 0; j < fpSpread1.Sheets[1].ColumnCount; j++)
     {
         fpSpread1.Sheets[1].Models.Data.SetValue(r, j, j + r * fpSpread1.Sheets[1].ColumnCount);
     }
 }
         
 fpSpread1.Sheets[0].ColumnFooter.Cells[0, i].Value = "2ndSum";
 fpSpread1.Sheets[0].ColumnFooter.Cells[0, 1].Formula = "SUM(Sheet2!A:A)";
```

**VB**

```vbnet
fpSpread1.Sheets.Count = 3
 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
 fpSpread1.Sheets(1).RowCount = 10
 fpSpread1.Sheets(1).ColumnCount = 15
 fpSpread1.Sheets(1).GroupBarInfo.Visible = True
 fpSpread1.Sheets(1).AllowGroup = True
 fpSpread1.Sheets(1).GroupFooterVisible = True
 fpSpread1.Sheets(1).ColumnFooter.Visible = True
 fpSpread1.Sheets(1).ColumnFooter.RowCount = 2
 fpSpread1.Sheets(1).ColumnFooter.Columns(12).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Left
 fpSpread1.Sheets(1).ColumnFooter.Cells(0, 12).RowSpan = 2
 'Value
 For r = 0 To fpSpread1.Sheets(1).RowCount
     For j = 0 To fpSpread1.Sheets(1).ColumnCount
         fpSpread1.Sheets(1).Models.Data.SetValue(r, j, j + r * fpSpread1.Sheets(1).ColumnCount)
     Next j
 Next r
 Dim i As Integer
i = 0
 fpSpread1.Sheets(0).ColumnFooter.Cells(0, i).Value = "2ndSum"
 fpSpread1.Sheets(0).ColumnFooter.Cells(0, 1).Formula = "SUM(Sheet2!A:A)"
```

## Set Column Footer Format

In Spread, you can show the column footer format in flat style using the **NumberFormat** property of the **IRange** interface.
![](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/number-format-flatstyle.png)
For example, you can display a comma as a thousands separator in the footer number format.
**C#**

```csharp
// Set flat style in Spread
fpSpread1.LegacyBehaviors = LegacyBehaviors.None;
fpSpread1.Reset();
fpSpread1.Sheets[0].Cells[0, 1, 10, 1].Value = 1000;
fpSpread1.Sheets[0].ColumnFooterVisible = true;
fpSpread1.Sheets[0].ColumnFooterRowCount = 1;
fpSpread1.Sheets[0].ColumnFooter.SetAggregationType(0, 1, FarPoint.Win.Spread.Model.AggregationType.Sum);
// Set number format in column footer
fpSpread1.AsWorkbook().ActiveSheet.ColumnFooter.Cells[0, 1].NumberFormat = "#,##0";
```

**VB**

```vbnet
' Set flat style in Spread
fpSpread1.LegacyBehaviors = LegacyBehaviors.None
fpSpread1.Reset()
fpSpread1.Sheets(0).Cells(0, 1, 10, 1).Value = 1000
fpSpread1.Sheets(0).ColumnFooterVisible = True
fpSpread1.Sheets(0).ColumnFooterRowCount = 1
fpSpread1.Sheets(0).ColumnFooter.SetAggregationType(0, 1, FarPoint.Win.Spread.Model.AggregationType.Sum)
' Set number format in column footer
fpSpread1.AsWorkbook().ActiveSheet.ColumnFooter.Cells(0, 1).NumberFormat = "#,##0"
```

## Wrap Text in Column Footers

You can customize text wrap in a column footer by setting the **WrapText** property of [IRange](/spreadnet/api/latest/online-win/GrapeCity.Spreadsheet/GrapeCity.Spreadsheet.IRange.html) Interface to true. Note that to view the wrapped text properly in the cell, you need to adjust the row height using the **RowHeight** property in the **ColumnFooter** class.
Before applying this **WrapText** property, ensure that the value of **ColumnHeaderRenderer.WordWrap2** property of the [SpreadSkin](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SpreadSkin.html) class is set to null. By default, the **ColumnHeaderRenderer.WordWrap2** value is null for the default skin only.
The following image depicts a preview of the wrapped text in the column footer.
![](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/wraptextfooter.png)
Use the sample codes below to wrap the column footer text using the **IRange.WrapText** property.
**C#**

```csharp
// Wrap text in column footer
activeSheet.ColumnFooter.Visible = true;
activeSheet.ColumnFooter.Cells.RowHeight = 90;
activeSheet.ColumnFooter.Cells[0, 0].Value = "This is a long footer text";
activeSheet.ColumnFooter.Cells[0, 0].WrapText = true;
```

**VB**

```vbnet
' Wrap text in column footer  
activeSheet.ColumnFooter.Visible = True
activeSheet.ColumnFooter.Cells.RowHeight = 90
activeSheet.ColumnFooter.Cells(0, 0).Value = "This is a long footer text"
activeSheet.ColumnFooter.Cells(0, 0).WrapText = True
```

## Set Column Style in Group Footer

In Spread, the you can customize the appearance of columns on the group footers using the **StyleManager** property of **FarPoint.Win.Spread.ModelGroupFooter** class of the **IGroupFooterStyleSupport** interface.
You can use the sample codes below to set column style in the group footer using the **StyleManager** property.
**C#**

```csharp
// Set column style in group footer
SheetView STestActiveSheet = fpSpread1.ActiveSheet;
IWorksheet TestActiveSheet = fpSpread1.AsWorkbook().ActiveSheet;
STestActiveSheet.RowCount = 6;
STestActiveSheet.ColumnCount = 4;
STestActiveSheet.Cells[0, 0, 3, 0].Value = 1;
STestActiveSheet.Cells[4, 0, 5, 0].Value = 2;
STestActiveSheet.Cells[0, 2, 3, 2].Value = DateTime.Today;
DefaultGroupFooterCollection defaultGroupFooterCol = new DefaultGroupFooterCollection(6, 4);
DefaultGroupFooter defaultGroupFooter = defaultGroupFooterCol[0];
ISheetDataModel model = defaultGroupFooter.DataModel as ISheetDataModel;
(model as IAggregationSupport).SetCellAggregationType(0, 2, AggregationType.Avg);
fpSpread1.ActiveSheet.DefaultGroupFooter = defaultGroupFooterCol;
GroupDataModel gdm = new GroupDataModel(STestActiveSheet.Models.Data);
STestActiveSheet.Models.Data = gdm;
gdm.Group(new SortInfo[] { new SortInfo(0, true) }, null);
fpSpread1.ActiveSheet.GroupFooterVisible = true;
var style = new StyleInfo();
style.BackColor = System.Drawing.Color.LightBlue;
DateTimeCellType dt = new DateTimeCellType();
dt.DateTimeFormat = DateTimeFormat.UserDefined;
dt.UserDefinedFormat = "dd.MM.yyyy HH:mm:ss";
style.CellType = dt;
style.HorizontalAlignment = CellHorizontalAlignment.Left;
for (int i = 0; i < gdm.Groups.Count; i++)
{
    var group = (Group)gdm.Groups[i];
    group.GroupFooter.StyleManager.SetColumnStyle(2, style);
}
```

**VB**

```vbnet
' Set column style in group footer
Dim STestActiveSheet As SheetView = fpSpread1.ActiveSheet
Dim TestActiveSheet As IWorksheet = fpSpread1.AsWorkbook().ActiveSheet
STestActiveSheet.RowCount = 6
STestActiveSheet.ColumnCount = 4
STestActiveSheet.Cells(0, 0, 3, 0).Value = 1
STestActiveSheet.Cells(4, 0, 5, 0).Value = 2
STestActiveSheet.Cells(0, 2, 3, 2).Value = Date.Today
Dim defaultGroupFooterCol As DefaultGroupFooterCollection = New DefaultGroupFooterCollection(6, 4)
Dim defaultGroupFooter As DefaultGroupFooter = defaultGroupFooterCol(0)
Dim model As ISheetDataModel = TryCast(defaultGroupFooter.DataModel, ISheetDataModel)
TryCast(model, IAggregationSupport).SetCellAggregationType(0, 2, AggregationType.Avg)
fpSpread1.ActiveSheet.DefaultGroupFooter = defaultGroupFooterCol
Dim gdm As GroupDataModel = New GroupDataModel(STestActiveSheet.Models.Data)
STestActiveSheet.Models.Data = gdm
gdm.Group(New SortInfo() {New SortInfo(0, True)}, Nothing)
fpSpread1.ActiveSheet.GroupFooterVisible = True
Dim style = New StyleInfo()
style.BackColor = Drawing.Color.LightBlue
Dim dt As DateTimeCellType = New DateTimeCellType()
dt.DateTimeFormat = DateTimeFormat.UserDefined
dt.UserDefinedFormat = "dd.MM.yyyy HH:mm:ss"
style.CellType = dt
style.HorizontalAlignment = CellHorizontalAlignment.Left
For i As Integer = 0 To gdm.Groups.Count - 1
   Dim group = CType(gdm.Groups(i), Group)
   group.GroupFooter.StyleManager.SetColumnStyle(2, style)
Next
```

The following image depicts the result of the above code.
![](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/columnstyleongroupfooter.png)

## Limitation

This feature doesn’t support painting for [graphical cell types](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-setcelltypes/spwin-setgraphcelltypes).

## See Also

[Managing Grouping of Rows of User Data](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-interact-rowcol/spwin-grouping)
[Sheets](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet)
[Working with the Active Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheetactive)
[Working with Multiple Sheets](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheetmulti)
[Adding a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheetadd)
[Removing a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheetremove)
[Showing or Hiding a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheethide)
[Moving a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheet-move)
[Copying and Inserting a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheetcopy)
[Adding a Title and Subtitle to a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheettitle)
[Placing Child Controls on a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-sheet-childcontrols)
[Adding a Tag to a Sheet](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/spwin-tags-sheet)
[Working with 1-Based Indexing](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-sheet/working-with-1based-indexing)