*/
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;
Object prevBindObject = null;
Object currBindObject = null;
ListElementMember element = null;
int leaderCount = 0;
String previousLeaderValue = null;
String currentLeaderValue = "";
int leaderHeaderIndex = 0;
ReportColumn[] cols = getColumns();
int colNumber = cols.length;
float currTotal1Amount = 0;
float currTotal2Amount = 0;
float currTotal3Amount = 0;
float total1Amount = 0;
float total2Amount = 0;
float total3Amount = 0;
float repTotal1Amount = 0;
float repTotal2Amount = 0;
float repTotal3Amount = 0;
String prevBindValue = null;
String currBindValue = "";
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 == 4) {
// quantiy
column = new String(column.toString());
}
element = outputObject(column, getColumnName(k));
if ( cols[k].isVisible() ) {
outputRow.add(element);
}
if (k == getLeader()) {
// get leader column value
currentLeaderValue = element.getDisplayString();
}
if (k == leaderBind) {
// save leader object for binding
currBindObject = column;
currBindValue = element.getDisplayString();
}
if (k == 6) {
// total amount sum 1
if (column instanceof Float) {
currTotal1Amount = ( (Float) column).floatValue();
}
else if (column instanceof Double) {
currTotal1Amount = ( (Double) column).floatValue();
}
}
else if (k == 8) {
// total amount sum 2
if (column instanceof Float) {
currTotal2Amount = ( (Float) column).floatValue();
}
else if (column instanceof Double) {
currTotal2Amount = ( (Double) column).floatValue();
}
}
else if (k == 9) {
// total amount sum 3
if (column instanceof Float) {
currTotal3Amount = ( (Float) column).floatValue();
}
else if (column instanceof Double) {
currTotal3Amount = ( (Double) column).floatValue();
}
}
}
}
if (prevBindValue == null ||
!prevBindValue.endsWith(currBindValue)) {
// 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(total1Amount, total2Amount, total3Amount,false));
// add end table line
result.add(getTableEnd());
// add table header line for new leader
result.add(getTableHeader());
}
previousLeaderValue = currentLeaderValue; // set new leader
prevBindObject = currBindObject; // set new bind object
prevBindValue = currBindValue; // set new bind value
leaderCount = 0; // reset leaderCount
leaderHeaderIndex = result.size() - 1; // set new header index
total1Amount = 0;
total2Amount = 0;
total3Amount = 0;
}
++leaderCount;
total1Amount += currTotal1Amount;
repTotal1Amount += currTotal1Amount;
total2Amount += currTotal2Amount;
repTotal2Amount += currTotal2Amount;
total3Amount += currTotal3Amount;
repTotal3Amount += currTotal3Amount;
contentRow.setShowType(ReportContentString.
SHOW_TYPE_TABLE_ROW);
contentRow.setReportRow(outputRow);
result.add(contentRow);
}
// actions for last leader
if (size > 0) {