Report footer from database

I want to use summary data from the database as a footer in xlsx template. I see there is some documentation on groovy but is it possible we can use a report band and SQL/JPQL?