>   Martin did not introduce variant_sumfield then for me it's not
recommended.

I agree and also it seems that using variant will make all the process
slower.

In the last code you give, in the first peace of code:

procedure tfrmbasePagefo.DoSum(oDbGrid: TDbwidgetgrid; iRow:integer);
VAR  n:currency; nn:integer; iCol:integer; oField:TField;
begin
with oDbGrid,oDbGrid.datalink.datasource do
for iCol:=0 to datacols.count-1 do
 with datacols[iCol]   do
 if  tag>0 then      
 begin
  oField:=dataset.fields[tag-1];
  if (oField.datatype = ftinteger)  then
  begin
   tmsebufdataset(DataSet).sumfield(oField,nn);
  
fixrows[iRow].captions[iCol].caption:=format(tnumericField(oField).DisplayFormat,[nn]);
   end
   else
   begin
   tmsebufdataset(DataSet).sumfield(oField,n);
  
fixrows[iRow].captions[iCol].caption:=format(tnumericField(oField).DisplayFormat,[n]);
   end;  end; end;

For me that code is OK, what problems do you have using it?

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/


_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to