I have played around with some test data in the EXAMPLE subsystem to see if I can achieve the result you desire. The only way I could do this was to modify the _cm_ListView_print_after() method to include a second argument for $next_row. My 'before' and 'after' methods are as follows:
// ****************************************************************************
function _cm_ListView_print_before ($prev_row, $curr_row)
// allow extra rows to be created in List View
{
$output = array();
if (!empty($prev_row)) {
// row has changed
if (substr($prev_row['last_name'], 0, 1) != substr($curr_row['last_name'], 0, 1)) {
// first character of last name has changed
$this->pdf->AddPage();
} // if
} // if
return $output;
} // _cm_ListView_print_before
// ****************************************************************************
function _cm_ListView_print_after ($curr_row, $next_row)
// allow extra rows to be created in List View
{
$output = array();
if (substr($next_row['last_name'], 0, 1) != substr($curr_row['last_name'], 0, 1)) {
// first character of last name has changed
$output[0]['pers_type_desc'] = 'after ' .$curr_row['person_id'];
} // if
return $output;
} // _cm_ListView_print_after
Attached are the framework scripts which I have modified. Try them out and let me know if they solve your problem.