FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ayuda con xbrowse
Posts: 0
Joined: unknown
ayuda con xbrowse
Posted: Thu Oct 28, 2021 09:45 PM

Hola gente, buenas tardes, que cambio en el xbrowse, tengo un programa que con la version 12.04 funcionaba perfecto el autosort y ahora con la 17.09 no logro hacer que funcione.

REDEFINE XBROWSE olbx ID 181 OF odlg FIELDS ;
str(clientes->numero,8),;
clientes->Nombre,;
clientes->Domic,;
clientes->copo,;
clientes->loca,;
clientes->tele,;
clientes->tipodoc,;
str(clientes->vendedor,2),;
str(clientes->lista,2),;
str(clientes->con_iva,2),;
clientes->cuit,;
memoline(clientes->conpago,40,1,.t.);
headers "Numero",;
"Nombre",;
"Domic",;
"C.Postal",;
"Localidad",;
oemtoansi("Tel‚fono"),;
"T.Doc.",;
oemtoansi("Vend."),;
"Lista",;
"IVA",;
"CUIT",;
oemtoansi("Condici¢n de pago");
ALIAS cAlias AUTOSORT CELL LINES NOBORDER font ofont1

Saludos.

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: ayuda con xbrowse
Posted: Fri Oct 29, 2021 06:50 PM
There is no change between 12.04 and 17.09 with regards to AUTOSORT.
If it works in 12.04 it should work with 17.09 also.

But as we can see from your code, autosort should not work either with 12.04 or 17.09.
Even assuming the DBF is indexed on all fields, how do you expect XBrowse to know which Index is to be used for which columnn?

In the above code, we should add the clause
Code (fw): Select all Collapse
SORT <ordTag1>, <ordTag2>,........, <ordTagN> ;

to inform XBrowse to which index tag for which column.


We keep advising in the forums not to use FIELDS clause but use COLUMNS clause. That allows XBrowse to know which index is to be used for which column.

Recommended way to define XBrowse:
Code (fw): Select all Collapse
REDEFINE XBROWSE olbx ID 181 OF odlg ;
   DATASOURCE cAlias ;
   COLUMNS "Numero","Nombre","Domic","copo","loca",     "tele",   "tipodoc","vendedor","Lista","con_iva","CUIT","conpago" ;
   HEADERS nil,      nil,    nil,"C.Postal","Localidad","TelFono","T.Doc",  "Vend.",  , nil,   "IVA",    nil,   "Condician de pago" ;
   PICTURES "999999999",nil, nil,     nil,   nil,        nil,      nil,     "99",       "99",  "99" ;
   AUTOSORT CELL LINES NOBORDER FONT ofont1


Now, XBrowse knows the field-names used for each column. From the field-names, xbrowse will check to see if an index exists for the column and uses that index for autosort.
Regards



G. N. Rao.

Hyderabad, India
Posts: 0
Joined: unknown
Re: ayuda con xbrowse
Posted: Thu Nov 04, 2021 03:09 PM

Excelente, muchas gracias.

Saludos
Jorge

Continue the discussion