I want to print a report with headers and lines of detail where each page print 50 lines and when switching between key print a new header.

I have always printed a record per page