xBrowse AUTOSORT DBF does not work

xBrowse AUTOSORT DBF does not work

Postby MOISES » Wed Dec 25, 2019 6:17 pm

Hello,

I have an xBrowse defined such way:

Code: Select all  Expand view  RUN
 @ 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  Expand view  RUN
  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
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: xBrowse AUTOSORT DBF does not work

Postby nageswaragunupudi » Thu Dec 26, 2019 4:05 am

Code: Select all  Expand view  RUN
@ 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
User avatar
nageswaragunupudi
 
Posts: 10653
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse AUTOSORT DBF does not work

Postby MOISES » Thu Dec 26, 2019 9:23 am

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
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: xBrowse AUTOSORT DBF does not work

Postby nageswaragunupudi » Thu Dec 26, 2019 10:01 am

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  Expand view  RUN
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  Expand view  RUN
COLUMNS "IMPORTE * ( 1 + ( IVA-IRPF) / 100 )", "NEXTCOL", ...
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10653
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 91 guests