cxgrid 如何在动态添加footer summaryitem 和group的item(100分)

H

hayoo

Unregistered / Unconfirmed
GUEST, unregistred user!
我在dbbandtableview 中,因为databse采用的是adoquery 而且字段是动态的有可能是字段a 有可能是字段b,因此要求 
With cxgrid1dbbandedtableview1.CreateColumn do
begin
Caption :='字段%';
DataBinding.FieldName:='字段%' ;
Position.BandIndex := 1;
Position.RowIndex := 0;
//Position.LineCount:=1;
Visible := True;
end;
同时创建footer 和 group
 
S

seabelial

Unregistered / Unconfirmed
GUEST, unregistred user!
呵呵,你是多少钱买的CXGRID?
 
H

hayoo

Unregistered / Unconfirmed
GUEST, unregistred user!
原来有帮助!刚才窗口太小没有拉下去,没有看到
 
H

hayoo

Unregistered / Unconfirmed
GUEST, unregistred user!
////////////////////////////////////////////////
with tvOrders.DataController.Summary do
begin
BeginUpdate;
try
with FooterSummaryItems.Add as TcxGridDBTableSummaryItem do
begin
Column := tvOrdersPaymentAmount;
Kind := skSum;
Format := 'SUM = $,0.00;-$,0.00';
end;
finally
EndUpdate;
end;

//Update all open details of the master view (tvCars)
tvCars.DataController.ClearDetails;
end;
//////////////////////////////
以上是TcxGridDBTableSummaryItem
但是我在tcxgriddbbandedtableview 中没有反应不显示??



、、、、、、、、、、、、、、、、、、
with tvOrders.DataController.Summary do

begin
BeginUpdate;
try
SummaryGroups.Clear;
//The first summary group
with SummaryGroups.Add do
begin
//Add proposed grouping column(s)
TcxGridTableSummaryGroupItemLink(Links.Add).Column := tvOrdersCustomerID;
//Add summary items
with SummaryItems.Add as TcxGridDBTableSummaryItem do
begin

Column := tvOrdersPaymentAmount;
Kind := skSum;
Format := 'Amount Paid: $,0';
end;

with SummaryItems.Add as TcxGridDBTableSummaryItem do
begin
Column := tvOrdersPaymentAmount;
Kind := skCount;
Format := 'Records: 0';
end;

end;

//The second summary group
with SummaryGroups.Add do

begin
//Add proposed grouping column(s)
TcxGridTableSummaryGroupItemLink(Links.Add).Column := tvOrdersProductID;
//Add summary items
with SummaryItems.Add as TcxGridDBTableSummaryItem do
begin
Column := tvOrdersQuantity;
Kind := skSum;
Position := spFooter;
Format := 'TOTAL = 0';
end;

with SummaryItems.Add as TcxGridDBTableSummaryItem do

begin
Column := tvOrdersPurchaseDate;
Kind := skMin;
Position := spFooter;
end;
end;

finally
EndUpdate;
end;
end;

、、、、、、、、、、、、、、、、、、、、、、、、、
group的也一样!
根据如下创建的字段 没有名字
With cxgrid1dbbandedtableview1.CreateColumn do
begin

Caption :='月%';
DataBinding.FieldName:='zpmp' ;
Position.BandIndex := 4;
Position.RowIndex := 0;
//Position.LineCount:=1;
Visible := True;
  showmessage(cxgrid1dbbandedtableview1.CreateColumn.Name);、、、
end;
从而引起了以上的错误,我想,不知道有没有高手帮忙

 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
857
import
I
顶部