Home > Back-end >  Questions about cxgrid footer display
Questions about cxgrid footer display

Time:10-01

I have put the cxGrid1DBTableView1 - & gt; Optionsview - & gt; Footer is set to True
At the same time in cxGrid1DBTableView1 - & gt; DataController - & gt; The Summary set FooterSummaryItems, including colom chose requirements and column, choose sksum kind, fieldname I fill is listed
But why can't put the sum after execution results show come out? Look Settings are all no problem!
Ask everybody to help


CodePudding user response:

Procedure TDecxGridDBBandedTableView. SetColGroupInfo (
Var col: TDecxGridDBBandedColumn; FooterKind: TcxSummaryKind; CaseFooter: Boolean);
Var tempstr1 tempstr2, tempFooterFormat tempGroupFooterFormat, tempGroupFormat: string;
The begin
If Assigned (col) then
The begin
Tempstr2:=EmptyStr;
If (Assigned (col. The Properties)) then
The begin
If (col. The Properties is TcxCalcEditProperties) then
The begin
Tempstr2:=TcxCustomTextEditProperties (col. The Properties). DisplayFormat;
end;
end;
DataController. Summary. The BeginUpdate;
Try
Case FooterKind of
SkCount:
The begin
Tempstr1:=(' record number: # 0 ');
TempFooterFormat:=tempstr1;
TempGroupFooterFormat:=tempstr1;
TempGroupFormat:=tempstr1;
end;
SkSum:
The begin
Tempstr1:=(' total: + tempstr2);
TempFooterFormat:=tempstr1;
Tempstr1:=(' subtotal: + tempstr2);
TempGroupFooterFormat:=tempstr1;
TempGroupFormat:=tempstr1;
end;
SkMax:
The begin
Tempstr1:=(' maximum: + tempstr2);
TempFooterFormat:=tempstr1;
TempGroupFooterFormat:=tempstr1;
TempGroupFormat:=tempstr1;
end;
SkMin:
The begin
Tempstr1:=(' minimum: # '+ tempstr2);
TempFooterFormat:=tempstr1;
TempGroupFooterFormat:=tempstr1;
TempGroupFormat:=tempstr1;
end;
SkAverage:
The begin
Tempstr1:=(' average: # '+ tempstr2);
TempFooterFormat:=tempstr1;
TempGroupFooterFormat:=tempstr1;
TempGroupFormat:=tempstr1;
end;
end;
//col. The Summary. GroupKind:=FooterKind; In the master record//after the grouping of
If CaseFooter then
The begin
Col. Summary. FooterKind:=FooterKind;
If FooterKind=skNone then
Col. Summary. FooterFormat:='
The else
Col. Summary. FooterFormat:=tempFooterFormat;
The status bar end//the end
The else
The begin
Col. Summary. GroupFooterKind:=FooterKind;//after the grouping of the master record status bar
If FooterKind=skNone then
Col. Summary. GroupFooterFormat:='
The else
Col. Summary. GroupFooterFormat:=tempGroupFooterFormat;
end;

(* if FooterKind=skNone then
The begin
Col. Summary. GroupFooterFormat:=';
Col. Summary. FooterFormat:=';
End
The else
The begin
{if tempGroupFormat<> "' then
The begin
If FooterKind=skCount then
Col. Summary. GroupFormat:=tempGroupFormat
The else
Col. Summary. GroupFormat:=col. Caption + "+ tempGroupFormat;
end; }
Col. Summary. GroupFooterFormat:=tempGroupFooterFormat;
Col. Summary. FooterFormat:=tempFooterFormat;
end; *)
The finally
DataController. Summary. EndUpdate;
end;
end;
end; This is my writing Settings combined function, you see is not useful to you

CodePudding user response:

CxGridList. GetColumnByFieldName (' fields'). The Summary. FooterKind:=skSum;

CodePudding user response:

Please code using the format tool processing, looks uncomfortable ah,
The following code is not complete, for reference only, to find the problem by themselves
 
AItem:=TcxGridDBTableSummaryItem (AcxGridView. DataController. Summary. FooterSummaryItems. Add);
AItem. Column:=AcxGridView. GetColumnByFieldName (AFieldName);
AItem. Kind:=SumKind;
AItem. Format:=AFormat;


http://hi.baidu.com/lemtech

CodePudding user response:

The first step: cxGrid1DBTableView1 - & gt; Optionsview - & gt; Footer is set to True
The second step: direct point form the Customize button


Colom choose requirements and column, choose sksum kind, fieldname blank is ok

CodePudding user response:

  • Related