ayuda con xbrowse

ayuda con xbrowse

Postby jpcavagnaro » Thu Oct 28, 2021 9: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.
Jorge
Saludos.
jpcavagnaro
 
Posts: 155
Joined: Tue Oct 11, 2016 1:02 pm
Location: Luján, bs. as.

Re: ayuda con xbrowse

Postby nageswaragunupudi » Fri Oct 29, 2021 6: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: Select all  Expand view

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

Re: ayuda con xbrowse

Postby jpcavagnaro » Thu Nov 04, 2021 3:09 pm

Excelente, muchas gracias.

Saludos
Jorge
Jorge
Saludos.
jpcavagnaro
 
Posts: 155
Joined: Tue Oct 11, 2016 1:02 pm
Location: Luján, bs. as.


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 92 guests