Ir al contenido


Foto

Ordenar en forma ascendente y descendente en RxMemoryData


  • Por favor identifícate para responder
2 respuestas en este tema

#1 cannabis

cannabis

    Advanced Member

  • Miembro Platino
  • PipPipPip
  • 257 mensajes
  • LocationMéxico

Escrito 09 diciembre 2009 - 09:18

¿Cómo puedo ordernar un RxMemoryData con un campo Ascendente y otro Descendente?

Algo así:


delphi
  1. rxmemorydata1.SortOnFields('Fecha ASC;Nombre ASC;Importe DESC')




Salud.



  • 0

#2 Rolphy Reyes

Rolphy Reyes

    Advanced Member

  • Moderadores
  • PipPipPip
  • 2.092 mensajes
  • LocationRepública Dominicana

Escrito 09 diciembre 2009 - 09:43

Saludos.

Estuve viendo el source y me parece que no es posible hacer esa operación.

Lo que si puedes intentar (haber si funciona) es poner los dos primeros campos como KeyFieldNames y pasar solo el campo importe marcándolo descendiente.

Algo así:


delphi
  1. rxmemorydata1.SortOnFields('Importe', False, True);



Code de SortOnFields:


delphi
  1. procedure TJvMemoryData.SortOnFields(const FieldNames: string = '';
  2.   CaseInsensitive: Boolean = True; Descending: Boolean = False);
  3. begin
  4.   if FieldNames <> '' then
  5.     CreateIndexList(FieldNames)
  6.   else
  7.   if FKeyFieldNames <> '' then
  8.     CreateIndexList(FKeyFieldNames)
  9.   else
  10.     Exit;
  11.   FCaseInsensitiveSort := CaseInsensitive;
  12.   FDescendingSort := Descending;
  13.   try
  14.     Sort;
  15.   except
  16.     FreeIndexList;
  17.     raise;
  18.   end;
  19. end;






  • 0

#3 cannabis

cannabis

    Advanced Member

  • Miembro Platino
  • PipPipPip
  • 257 mensajes
  • LocationMéxico

Escrito 09 diciembre 2009 - 09:47

Te agradezco mi estimado Rolphy.

Haré pruebas con tu idea.


Salud.

  • 0




IP.Board spam blocked by CleanTalk.