A problem xBrowse seek on DATE and NUMERIC ?

A problem xBrowse seek on DATE and NUMERIC ?

Postby ukoenig » Mon Jan 16, 2017 6:39 pm

Mr. Rao,

You posted :

Please go to METHOD AdoIncrSeek and locate the following line:

do case
case cType == 'C'

Change it as

do case
case cType == 'C' .or. uVal == nil

Well with this modification incremental filters on numeric and date columns may fail.

In my tests, DATE and NUMERIC - seek is not working
The first browse uses the new seekbar. the second the old fashion way.
CHARACTER and LOGICAL is working normal.
With NUMERIC and DATE the colums are sorted but the seek doesn't work.
( I can include this test for DOWNLOAD if needed )

The tested INDEX-builds :

USE CUSTOMER
ORDCREATE( ,"CUST1","UPPER(FIRST)", {|| UPPER(FIRST) } , .F. )
ORDCREATE( ,"CUST2","UPPER(LAST)", {|| UPPER(LAST) } , .F. )
ORDCREATE( ,"CUST3","DTOS(HIREDATE)", {|| DTOS(HIREDATE) } , .F. )
//ORDCREATE( ,"CUST3","DTOC(HIREDATE)", {|| DTOC(HIREDATE) } , .F. )
//ORDCREATE( ,"CUST3","HIREDATE", {|| HIREDATE } , .F. )
ORDCREATE( ,"CUST4","MARRIED", {|| MARRIED } , .F. )
ORDCREATE( ,"CUST5","STR(SALARY)", {|| STR(SALARY) } , .F. )
//ORDCREATE( ,"CUST5","SALARY", {|| SALARY } , .F. )


Image

failed on DATE and NUMERIC

Image

Any idea ?

regards
Uwe :?:
Last edited by ukoenig on Sun Jan 29, 2017 10:27 am, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: A problem xBrowse seek on DATE and NUMERIC ?

Postby nageswaragunupudi » Tue Jan 17, 2017 3:00 am

Numerics and dates are sorted in the order of the values, not as character values.
So the seeks can not be on the initial characters as they appear in the browse.

Numerics: Seek to the value next higher than the value entered.
Dates: Seeks to the value next higher than the value in YYYYMMDD format
Regards

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

Re: A problem xBrowse seek on DATE and NUMERIC ?

Postby ukoenig » Fri Jan 27, 2017 3:24 pm

Mr. Rao,

it seems, there is still another problem

both defined ( edit and seek ) doesn't work and is showing a funny effect.

Code: Select all  Expand view

WITH OBJECT oBrw1
     ....
     ....
     :nEditTypes := EDIT_GET
     ....
     ....
     :lSeekBar := .t.
     ....
END
 


Image

something must be changed ?

regards
Uwe :?:
Last edited by ukoenig on Sat Jan 28, 2017 8:32 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: A problem xBrowse seek on DATE and NUMERIC ?

Postby nageswaragunupudi » Fri Jan 27, 2017 6:18 pm

Mr Uwe

You are right.

Please make these corrections in the Method Edit( nKey ) of TXBrwColumn:
Replace Line 13089 of FWH1701 ( line 13007 of FWH1612 )
Code: Select all  Expand view

   nRow    := ( ( ::oBrw:nRowSel - 1 ) * ::oBrw:nRowHeight ) + ::oBrw:HeaderHeight()
 

with
Code: Select all  Expand view

   nRow    := ( ( ::oBrw:nRowSel - 1 ) * ::oBrw:nRowHeight ) + ::oBrw:FirstRow()
 


Also replace line 13135 (FWH1701) / line 13053 (FWH1612)
Code: Select all  Expand view

   nRow    := ( ( ::oBrw:nRowSel - 1  ) * ::oBrw:nRowHeight ) + ::oBrw:HeaderHeight() + 2
 

with
Code: Select all  Expand view

   nRow    := ( ( ::oBrw:nRowSel - 1  ) * ::oBrw:nRowHeight ) + ::oBrw:FirstRow() + 2
 
Regards

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

Re: A problem xBrowse seek on DATE and NUMERIC ?

Postby ukoenig » Sat Jan 28, 2017 8:34 pm

Mr. Rao,

thank You very much.
With these changes it works fine.

Image

I still noticed another problem
A defined header-image for logical fields is not shown.
Instead a checkbox is displayed.
With all other fieldtyps it is working.
In my sample I'm testing a index on ALL fieldtypes

Image

WITH OBJECT oBrw1:Married
:AddBmpFile( "Sort.bmp" ) // Index-image
:nHeadBmpNo := 1
END

regards
Uwe :D
Last edited by ukoenig on Sun Jan 29, 2017 10:15 am, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: A problem xBrowse seek on DATE and NUMERIC ?

Postby nageswaragunupudi » Sun Jan 29, 2017 2:32 am

SetCheck() adds to 2 bitmaps the the column.
After that the bitmap ("sort.bmp") you added is the 3rd bitmap.
So you should use
:nHeadBmpNo := 3

Method AddBitmap( <bmpfile/resource/array> ) superceded obsolete methods AddBmpFile() and AddResource() from FWH 10.01

:nHeadBmpNo := :AddBitmap( "sort.bmp" )
Regards

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

Re: A problem xBrowse seek on DATE and NUMERIC ?

Postby ukoenig » Sun Jan 29, 2017 10:16 am

Thank You very much.
Now everything of my test is working

Image

before adding a download, I will do some code cleaning ( and maybe adding some useful things )

I added Your expositions to the code like

oBrw1:Married:SetCheck() // Default FWH Bitmap is Alpha
/*
SetCheck() adds to 2 bitmaps to the column.
After that the bitmap ("sort.bmp") you added is the 3rd bitmap.
So you should use
:nHeadBmpNo := 3
Method AddBitmap( <bmpfile/resource/array> ) superceded obsolete methods AddBmpFile()
and AddResource() from FWH 10.01
:nHeadBmpNo := :AddBitmap( "sort.bmp" )
*/


as well a readme.txt for the xbrowse-changes is included

Please make these corrections in the Method Edit( nKey ) of TXBrwColumn:
Replace Line 13089 of FWH1701 ( line 13007 of FWH1612 )

nRow := ( ( ::oBrw:nRowSel - 1 ) * ::oBrw:nRowHeight ) + ::oBrw:HeaderHeight()
with
nRow := ( ( ::oBrw:nRowSel - 1 ) * ::oBrw:nRowHeight ) + ::oBrw:FirstRow()

Also replace line 13135 (FWH1701) / line 13053 (FWH1612)
nRow := ( ( ::oBrw:nRowSel - 1 ) * ::oBrw:nRowHeight ) + ::oBrw:HeaderHeight() + 2
with
nRow := ( ( ::oBrw:nRowSel - 1 ) * ::oBrw:nRowHeight ) + ::oBrw:FirstRow() + 2


regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 110 guests