unigui unidbgrid显示列的合计值

procedure TfrmClient.UniDBGrid1ColumnSummaryResult(Column: TUniDBGridColumn;
GroupFieldValue: Variant; Attribs: TUniCellAttribs; var Result: string);
var
f: Currency;
begin
inherited;
if SameText(Column.FieldName,'beginBalance') then
begin
f:=0;
ClientDataSet1.First;
while not ClientDataSet1.Eof do
begin
f:= f + Column.Field.Value;
ClientDataSet1.Next;
end;
Result :=formatCurr('¥0.00',f);
Attribs.font.Style:= [fsBold];
Attribs.Font.Color:= clNavy;
end;
end;

你可能感兴趣的:(grid)