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 property of the SheetView class and the various members of the ColumnFooter class.
To calculate the column footer or group footer result with a formula, set the SetAggregationType 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:
The group footer is an extra row that is displayed below the group after grouping by a column header. The GroupFooterVisible property must be set to true after the group has been created. The Grouped 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.
Set the Visible property of the ColumnFooter for the sheet.
This example code displays a column footer and sets a span and a text color.
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.
This example code displays a column footer and adds a formula from a different sheet.
In Spread, you can show the column footer format in flat style using the NumberFormat property of the IRange interface.
For example, you can display a comma as a thousands separator in the footer number format.
You can customize text wrap in a column footer by setting the WrapText property of IRange 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 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.
Use the sample codes below to wrap the column footer text using the IRange.WrapText property.
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.
The following image depicts the result of the above code.
This feature doesn’t support painting for graphical cell types.