To output a footer for each group, place a text component with an aggregation function in the group footer. You can also put the group footer in the group header band. For example, to count the number of lines in each group in a text component, you could use an expression like this:
{Count()}
Components are placed in the group footer band.
After rendering, you can see that the footer for each group is calculating by the number of rows.