Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Conexión con bases de datos (https://www.clubdelphi.com/foros/forumdisplay.php?f=2)
-   -   Agregado, Filtro, ClientDataSet, Problema en Count() (https://www.clubdelphi.com/foros/showthread.php?t=12631)

andre 22-07-2004 15:48:10

Agregado, Filtro, ClientDataSet, Problema en Count()
 
Hola,

Tengo un ClientDataSet el cual tiene un agregado para calcular el total de registros, al asignar un filtro este se actualiza bien, pero al eliminar el filtro, la cantidad de registros es igual al total mas el total cuando estaba el filtro.

¿Que podria estar fallando?. Para filtrar uso:
Código:

ClientDataSet1.Filter := 'monto >= ' + Edit1.Text;
ClientDataSet1.Filtered := True;

y para eliminarlo:

Código:

ClientDataSet1.Filtered := False;
ClientDataSet1.Filter := '';

Muchas gracias.

ruina 23-07-2004 14:47:07

Se me ocurre activar y desactivar el agregate si el filtro es vacio:
Código Delphi [-]
ClientDataSet1.Aggregates.Find('numero').Active:=FALSE;
ClientDataSet1.Aggregates.Find('numero').Active:=TRUE;

lo he probado y funciona


La franja horaria es GMT +2. Ahora son las 16:12:17.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi