Page 1 of 1

Search on xbrowse

PostPosted: Sun Aug 05, 2018 5:44 pm
by Silvio.Falconi
I wish make a search on xbrowse
My customer wish have 3 Get ( first,last,City) and search these data on xbrowse
I wish the final user can insert a letter on one of the 3 gets and the procedure must search the data and refresh the xbrowse

I try with a small test but it not run ok ( or I not understtod how make it)
I try to search a sample on this forum but i not found any test for implement my app

this is the test
Code: Select all  Expand view

#include 'fivewin.ch'
#include 'xbrowse.ch'

REQUEST DBFCDX
REQUEST DBFFPT
EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO

function Main()

   local oDlg, oBrw, oFont

   //to search a record
   Local oSaySearch:= array(3)
   Local aGetSearch:= array(3)
   Local cSearcFirst,cSearchLast,cSearchCity

 // for the search
   cSearcFirst:=space(15)
   cSearchLast:=space(15)
   cSearchCity:=space(15)

 RddSetDefault( "DBFCDX" )

   USE CUSTOMER ALIAS CUST

   DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -14

   DEFINE DIALOG oDlg SIZE 640,440 PIXEL ;
      FONT oFont TITLE 'XBrowse Search test'

   @ 10, 10 XBROWSE oBrw OF oDlg SIZE 300, 180 PIXEL ;
      AUTOCOLS ALIAS 'CUST' NOBORDER

   oBrw:nMarqueeStyle    = MARQSTYLE_HIGHLWIN7
   oBrw:CreateFromCode()

        @ 200, 10 say oSaySearch[1] Prompt "First:"   of oDlg Size 40,10 PIXEL
        @ 200, 120  say oSaySearch[2] Prompt "Last:"    of oDlg Size 40,10  PIXEL
        @ 200, 210 say oSaySearch[3] Prompt "City:"    of oDlg Size 40,10   PIXEL

        @ 200, 50 GET aGetSearch[1] VAR cSearcFirst   of oDlg Size 60,12 PIXEL  ;
        ON CHANGE (oBrw:bseek(Upper(cSearcFirst)),oBrw:refresh())

        @ 200, 140 GET aGetSearch[2] VAR cSearchLast   of oDlg Size 60,12 PIXEL
        @ 200, 250 GET aGetSearch[3] VAR cSearchCity   of oDlg Size 60,12 PIXEL

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont

return nil
 

Re: Search on xbrowse

PostPosted: Sun Aug 05, 2018 6:24 pm
by ukoenig
Why not using a seekbar :?:

Image

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

:lSeekBar := .t.
:bClrEdits := { || { CLR_HRED, CLR_YELLOW } }


regards
Uwe :?:

Re: Search on xbrowse

PostPosted: Sun Aug 05, 2018 9:25 pm
by Silvio.Falconi
Please
I am not interested in searching over the bar. ( seekBar)

I have not been able to convince our customer to other solutions other than that decided by the customer

In fact I am recreating all the screens according to when decided by our customer.

Our client wants to have 3 gets one for the last name, one for the name and one for the city. when inserting a letter into one of the three it automatically gets the xbrowse to search and refresh