*/
public void processReport(int i, Vector res, ArrayList result) {
int size = 0;
int rowSize = 0;
ReportContentString contentRow = null;
ArrayList row = null;
ArrayList outputRow = null;
Object column = null;
ListElementMember element = null;
int leaderCount = 0;
String previousLeaderValue = null;
String currentLeaderValue = "";
int leaderHeaderIndex = 0;
ReportColumn[] cols = getColumns();
int colNumber = cols.length;
// current row durations
long currDuration = 0;
long currBreakDuration = 0;
long currNetDuration = 0;
// current leader total durations
long duration = 0;
long breakDuration = 0;
long netDuration = 0;
// report total durations
long repDuration = 0;
long repBreakDuration = 0;
long repNetDuration = 0;
switch (i) {
case 0:
size = res.size();
// set leader line index
leaderHeaderIndex = result.size();
// add table header line for new leader
result.add(getTableHeader());
for (int j = 0; j < size; ++j) {
row = (ArrayList) res.get(j);
contentRow = new ReportContentString();
outputRow = new ArrayList();
rowSize = row.size();
for (int k = 0; k < rowSize; ++k) {
if ( k < colNumber ) {
column = row.get(k);
if (k == getLeader()) {
// get leader column value
currentLeaderValue = column.toString();
}
if (k == 4) {
// duration
currDuration = ((Long)column).longValue();
column = new String(DateUtility.secsToString(currDuration));
}
else if (k == 5) {
// break duration
currBreakDuration = ((java.math.BigDecimal)column).intValue();
column = new String(DateUtility.secsToString(currBreakDuration));
}
else if (k == 6) {
// net duration
currNetDuration = ((java.math.BigDecimal)column).intValue();
column = new String(DateUtility.secsToString(currNetDuration));
}
element = outputObject(column, getColumnName(k));
if ( cols[k].isVisible() ) {
outputRow.add(element);
}
}
}
if (previousLeaderValue == null ||
!previousLeaderValue.equals(currentLeaderValue)) {
// leader changed, now we need form header for
if (leaderCount > 0) {
// add header line for previous leader(leader name and Record Count)
result.add(leaderHeaderIndex,
getLeaderHeader(previousLeaderValue));
// add total amount line
result.add(getTotals(duration, breakDuration, netDuration,false));
// add end table line
result.add(getTableEnd());
// add table header line for new leader
result.add(getTableHeader());
}
previousLeaderValue = currentLeaderValue; // set new leader
leaderCount = 0; // reset leaderCount
leaderHeaderIndex = result.size() - 1; // set new header index
duration = 0;
breakDuration = 0;
netDuration = 0;
}
++leaderCount;
duration += currDuration;
repDuration += currDuration;
breakDuration += currBreakDuration;
repBreakDuration += currBreakDuration;
netDuration += currNetDuration;
repNetDuration += currNetDuration;
contentRow.setShowType(ReportContentString.
SHOW_TYPE_TABLE_ROW);
contentRow.setReportRow(outputRow);
result.add(contentRow);
}
// actions for last leader
if (size > 0) {