xBrowse AUTOSORT DBF does not work

Post Reply
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

xBrowse AUTOSORT DBF does not work

Post by MOISES »

Hello,

I have an xBrowse defined such way:

Code: Select all

  @ 14,72 XBROWSE oVMenuBrowse SIZE -10,-21 PIXEL OF oDlg ;
          ALIAS "CLIENTES" AUTOSORT;
          FIELDS CLIENTES->CODIGO,CLIENTES->NOMBRE ;
          HEADERS "Código", "Nombre"  ;
          SIZES  90, 80
 
Indexes are:

Code: Select all

   INDEX ON NOMBRE TAG CLIENTES1  FOR !Deleted()
   INDEX ON CODIGO TAG CLIENTES2  FOR !Deleted()
Thank you.
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse AUTOSORT DBF does not work

Post by nageswaragunupudi »

Code: Select all

@ 14,72 XBROWSE oVMenuBrowse SIZE -10,-21 PIXEL OF oDlg ;
          ALIAS "CLIENTES" AUTOSORT;
          COLUMNS "CODIGO","NOMBRE" ;
          HEADERS "Código", "Nombre"  ;
          SIZES  90, 80
 
Autosort works when you use COLUMNS clause like this. Does not work when you use FIELDS clause.

We advise you to use COLUMNS clause only and never to use FIELDS clause.

Note: FIELDS clause was created for compatibility with WBrowse syntax to ease initial migration.
Regards

G. N. Rao.
Hyderabad, India
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Re: xBrowse AUTOSORT DBF does not work

Post by MOISES »

Thank you.

But in some xbrowse cols, I have defined the field like this:

( CONCEPTO->IMPORTE + (CONCEPTO->IMPORTE*CONCEPTO->IVA/100) - (CONCEPTO->IMPORTE*CONCEPTO->IRPF/100) )

But in COLUMNS clause does not work. How should I proceed please?
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: xBrowse AUTOSORT DBF does not work

Post by nageswaragunupudi »

In the COLUMNS clause, we can include expressions also, as long as the expression can be evaluated in another module, i.e., expressions not containing local variables or static functions.

The above can be written as

Code: Select all

COLUMNS "IMPORTE+(IMPORTE*IVA/100)-(IMPORTE*IRPF/100)", "NEXTCOL", ...
Incidentally, the expression IMPORTE+(IMPORTE*IVA/100)-(IMPORTE*IRPF/100) can be simplified as IMPORTE * ( 1 + ( IVA-IRPF) / 100 )

So we can write

Code: Select all

COLUMNS "IMPORTE * ( 1 + ( IVA-IRPF) / 100 )", "NEXTCOL", ...
Regards

G. N. Rao.
Hyderabad, India
Post Reply