*/
public void processReport(int i, Vector queryResults, ArrayList reportOutput)
{
int numberOfRows = 0;
int numberOfColumns = 0;
ReportContentString contentRow = null;
ArrayList row = null;
ArrayList outputRow = null;
Object column = null;
ListElementMember element = null;
String previousIndividualName = null;
String currentIndividualName = "";
int individualIndex = 0;
String entityName = "";
int entityIndex = 1;
String accountManagerName = "";
int amIndex = 2;
int leaderHeaderIndex = 0;
ReportColumn[] cols = getColumns();
int colNumber = cols.length;
numberOfRows = queryResults.size();
// set leader line index
leaderHeaderIndex = reportOutput.size();
// set header line
reportOutput.add(getTableHeader());
// process each row.
for (int j = 0; j < numberOfRows; ++j) {
row = (ArrayList) queryResults.get(j);
contentRow = new ReportContentString();
outputRow = new ArrayList();
numberOfColumns = row.size();
// process each column
for (int k = 0; k < numberOfColumns; ++k) {
if (k < colNumber) {
column = row.get(k);
element = outputObject(column, getColumnName(k));
if (cols[k].isVisible()) {
outputRow.add(element);
}
if (k == individualIndex) {
currentIndividualName = element.getDisplayString();
}
if (k == entityIndex) {
entityName = element.getDisplayString();
}
if (k == amIndex) {
accountManagerName = element.getDisplayString();
}
}
}
// update the leader info.
if (previousIndividualName == null || !previousIndividualName.equals(currentIndividualName)) {
// leader changed, now we need form header for
reportOutput.add(leaderHeaderIndex, getLeaderHeader(previousIndividualName, entityName, accountManagerName));
// add end table line
reportOutput.add(getTableEnd());
// add table header line for new leader
reportOutput.add(getTableHeader());
previousIndividualName = currentIndividualName; // set new leader
leaderHeaderIndex = reportOutput.size() - 1; // set new header index
}
contentRow.setShowType(ReportContentString.SHOW_TYPE_TABLE_ROW);
contentRow.setReportRow(outputRow);
reportOutput.add(contentRow);
}
// add header line for last leader
if (numberOfRows > 0) {
reportOutput.add(leaderHeaderIndex, getLeaderHeader(previousIndividualName, entityName, accountManagerName));