There is a funtion "OnLastRecord" to get the last record of report, you could do supress some sections or others by this case.