Record Template - Conditionally printing sections

Record Template - Conditionally printing sections

Is there a way to conditionally print a section of a Record Template?
More specifically I am printing records from a Form "Invoice". That Form has 3 SubForms. I'd like to print the content of those SubForms using a Record Template but only if they have at least one line item. If they have no line items, I'd like to hide the headers for that section on the printout.