clientdataset 实现分组和索引

  if qryformx.Active then
    qryformx.Close;
  qryformx.createdataset;
  qryformx.Open;
  qryformx.AddIndex('qryformxIndex1','pzh;bm;mc;ybbm;ybmc;sglxbm;sglx;sgysbm;sgys',[],'', '',9);
  { 给数据集指定此索引 }
  qryformx.IndexName := 'qryformxIndex1';
  qryformx.Close;
  with TAggregateField.Create(Self) do begin
    FieldName := 'pricesum';
    Expression := 'Sum(price)';
    IndexName := 'qryformxIndex1';
    GroupingLevel := 9;
    Active := True;
    OnGetText := qryformxpricesumGetText;
    DataSet := qryformx;
  end;
  qryformx.open;
  qryformx.AggregatesActive := True;

你可能感兴趣的:(索引,分组,Clientdataset)