Group totals in print formats

Is there a sample/howto document on creating print formats that allows group totals.

I would like to print receipts grouped by customer so that I can get group totals by customer and grand total for all receipts within a date range.

Is it print format or report?

Print format more important. Report not so much.