You can add a header section to a repeating list of elements that will appear at the top of that section, or not appear at all if there are no elements in that section.
The example I’ll use here is a section that shows all of the use cases that are top priority but implementation hasn’t started yet. I want to add that to my weekly status report to show what’s scheduled but not yet started. I want a heading to draw attention to that section, but only if there are any use cases in that state.
The $showonce keyword is used inside a $repeat loop to accomplish this. Add a header section inside a $showonce … $endshowonce section within the repeat section, and whatever is there will only show up through the first pass. Here’s an example:
CaseComplete Development Team
$repeatUseCases where Priority = 1 and ImplStatus = ‘Scheduled’
Project Use Cases Not Started
These are the use cases that are listed as top priority and are scheduled for this iteration but implementation has not yet started.
When the report is generated, the scheduled-but-not-yet-started use cases will show up with the header section. If no use cases meet the criteria, there won’t be an orphaned header section messing up my report.