1. If you have access to program script, initialize one variable say printed = 0. When you are doing a rprt_send() you can assign a value to that variable say printed = 1.
Now, in your layout, put print expression for header as printed = 1. Now, it will be printed only when there is some data in the details.
2. If you don't have access to program script, check in the before.layout section of header that if there are any detail lines to be printed. As suggested in point 1, initialize a variable and assign if found.
If nothing found do lattr.print = false
Unless you try to do something beyond what you have already mastered, you will never grow!