For this report a named column type report template is used
The row templates are:
<div class="department">
#DEPARTMENT#
</div>
<span class="employee">
#EMPLOYEE#
</span>
With the condtion #RN# = 1
<span class="employee">
#EMPLOYEE#
</span>
With the condition #RN#<>1
The breaking effect is established by calculating the rownumber within the department.
And using 2 different templates depending on the row number.
The select statement used is:
select dep.department_name department
, EMP.LAST_NAME employee
, row_number() over (partition by emp.department_id
order by emp.last_name) rn
from OEHR_EMPLOYEES EMP
left outer join oehr_departments dep
on dep.department_id = emp.department_id