Sorting in ClientDataSet

0

I tried to sort ClientDataSet according to the guidelines below but did not accept grouping the orders:

Does not accept:

(ClientDataSet1.IndexName := 'DataNascimentoAscdx;OrdenarUltimoPrimeiroNomedx';)

Only accept if you have one:

ClientDataSet1.IndexName := 'DataNascimentoAscdx'; 

Does anyone know where my error is?

with ClientDataSet1.IndexDefs.AddIndexDef do 
begin 
  Name := 'OrdenarUltimoPrimeiroNomedx'; 
  Fields := 'UltimoNome;PrimeiroNome';
  Options := [ixDescending, ixCaseInsensitive]; 
end; 

with ClientDataSet1.IndexDefs.AddIndexDef do 
begin 
  Name := 'DataNascimentoAscdx'; 
  Fields := 'DataNascimento';
  Options := [ixAscending]; 
end; 

ClientDataSet1.IndexName := 'DataNascimentoAscdx;OrdenarUltimoPrimeiroNomedx'; 

Found Solution     with ClientDataSet1.IndexDefs.AddIndexDef     begin       Name: = 'SortLastFirstNomedx';       DescFields: = 'LastName'; // Place all fields that will be sorted Descending, the others will be sorted Ascending       Fields: = 'LastName; FirstName';       Options: = [ixDescending];     end;   ClientDataSet1.IndexName: = 'SortLastFirstNomedx';

// ixAscending does not exist, to sort some growing field just leave: Options: = []; // Without anything

    
asked by anonymous 10.02.2018 / 13:40

0 answers