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;

posted @ 2015-04-12 22:57  delphi中间件  阅读(2313)  评论(0编辑  收藏  举报