问题描述:

amount.setAlign(Alignment.RIGHT);

amount.setRecordSummaryFunction(RecordSummaryFunctionType.MULTIPLIER);

amount.setSummaryFunction(SummaryFunctionType.SUM);

amount.setShowGridSummary(true);

amount.setShowGroupSummary(true);

amount.setCellFormatter(new CellFormatter() {

public String format(Object value, ListGridRecord record, int rowNum, int colNum) {

if (value == null) return null;

try {

NumberFormat nf = NumberFormat.getFormat("#,##0.00");

return nf.format(((Number) value).doubleValue());

} catch (Exception e) {

return value.toString();

}

}

});

ShipCost.setType(ListGridFieldType.FLOAT);

ShipCostIn.setType(ListGridFieldType.FLOAT);

LvingCost.setType(ListGridFieldType.FLOAT);

allowance.setType(ListGridFieldType.FLOAT);

amount.setType(ListGridFieldType.FLOAT);

Amount is a field name and I want to sum it by these feilds' values.

I thought the code can do,but,no....

Thx for your answers.

相关阅读:
Top