Search record from tab

Search record from tab

Postby Silvio.Falconi » Tue Sep 15, 2015 9:12 am

i Have a tabs on the bottom of a xbrowse
I use customer.dbf of fwh samples

Image

How I can make to search on xbrowse the customer with initial letter sample " A" when I click on tab ?

the first tab "tutti" as "All show"

thanks in advance
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: Search record from tab

Postby nageswaragunupudi » Wed Sep 16, 2015 7:09 am

When a tab is pressed:
Action ( oBrw:Seek( "A" ) )
or oBrw:Seek( "B" )
for Tuti oBrw:Seek( "" )
Regards

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

Re: Search record from tab

Postby Silvio.Falconi » Wed Sep 16, 2015 7:51 am

Sorry Mr rao ,
I made

@ oApp():oDlg:nGridBottom, nSplit+2 TABS oApp():oTab ;
OPTION nOrder SIZE oApp():oWndMain:nWidth()-80, 12 PIXEL OF oApp():oDlg ;
ITEMS "Tutti","A","B","C","D","E","F","G","H","I","J","K","L","M","N","Ñ","O","P","Q","R","S","T","U","V","W","X","Y","Z" ;
ACTION ( CU->(DbSetOrder(1)),;
CU->(DbGoTop()) ,;
IIF( oApp():oTab:nOption=1, oApp():oGrid:Seek(""),;
oApp():oGrid:Seek(alltrim(oApp():oTab:aPrompts[oApp():oTab:nOption] )) ),;
oApp():oGrid:Refresh(.t.) )


it run ok bu tI mean to show
sample only that customer init for "A" or "B" ...
I hope you understand me

I tried with
CU->(DbSetFilter( alltrim(Left(CU->First,1))==alltrim(oApp():oTab:aPrompts[oApp():oTab:nOption] ) )),;
oApp():oGrid:refresh(),;

but it not run
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: Search record from tab

Postby Silvio.Falconi » Thu Sep 17, 2015 7:51 am

I tried :

@ oApp():oDlg:nGridBottom, nSplit+2 TABS oApp():oTab ;
OPTION nOrder SIZE oApp():oWndMain:nWidth()-80, 12 PIXEL OF oApp():oDlg ;
ITEMS "Tutti","A","B","C","D","E","F","G","H","I","J","K","L","M","N","Ñ","O","P","Q","R","S","T","U","V","W","X","Y","Z" ;
ACTION ( CU->(DbSetOrder(nOrder)),;
Cufiltrar(oApp():oGrid, oApp():oTab,oApp():oTab:nOption) )



Function Cufiltrar (oGrid,oTab,n,nOrder)

?alltrim(oApp():oTab:aPrompts[n] )
do case
case nOrder= 1
CU->(DbSetFilter( alltrim(Left(CU->First,1))==alltrim(oApp():oTab:aPrompts[n] ) ))

case nOrder= 2
CU->(DbSetFilter( alltrim(Left(CU->Last,1))==alltrim(oApp():oTab:aPrompts[n] ) ))

endcase
CU->(DbGoTop())
oApp():oGrid:Refresh(.t.)
return nil


but it not run

If I use Wdbu and make a filter sample Left(cu->first,1)="A" it run
why on fwh not run ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: Search record from tab

Postby Silvio.Falconi » Thu Sep 17, 2015 8:10 am

Mr Rao
I made

@ oApp():oDlg:nGridBottom, nSplit+2 TABS oApp():oTab ;
OPTION nOrder SIZE oApp():oWndMain:nWidth()-80, 12 PIXEL OF oApp():oDlg ;
ITEMS "Tutti","A","B","C","D","E","F","G","H","I","J","K","L","M","N","Ñ","O","P","Q","R","S","T","U","V","W","X","Y","Z" ;
ACTION CuFiltrar(oApp:oGrid,oApp:oTab,oApp():oTab:nOption,nOrder)


Function CuFiltrar(oGrid,oTab,n,nOrder)

if n=1
CU->(DbClearFilter())
CU->(DbGoTop())
oApp():oGrid:Refresh(.t.)
return nil
endif

do case
case nOrder= 1
set filter to left(CU->FIRST,1)=oApp():oTab:aPrompts[n]
case nOrder= 2
set filter to left(CU->LAST,1)=oApp():oTab:aPrompts[n]
endcase
CU->(DbGoTop())
oApp():oGrid:Refresh(.t.)
return nil



It run ok now but perhaps there is a method ( with codeblocks) to show the same ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: Search record from tab

Postby James Bott » Thu Sep 17, 2015 2:51 pm

User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Search record from tab

Postby Silvio.Falconi » Fri Sep 18, 2015 7:14 am

James,
Nw with Setfilter run ok
only I ask if there is a method more good
ordscope I never use or perhaps I not remember
but I not found a test sample with ordscope to try
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: Search record from tab

Postby ukoenig » Fri Sep 18, 2015 9:16 am

Silvio,

a sample :

from ORD.CH :

#define TOPSCOPE 0
#define BOTTOMSCOPE 1

set order to tag dates
// set range
dates->(ordScope(0, dtos(Start) )) // set top scope
dates->(ordScope(1, dtos(End) )) // set bottom scope
dates->(dbgotop())
dates->(ordScope(0, NIL )) // set top to NIL
dates->(ordScope(1, NIL )) // set bottom to NIL


best 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

Re: Search record from tab

Postby James Bott » Fri Sep 18, 2015 2:24 pm

Silvio,

I never use set filter anymore, ordscope is so much faster. You will love it, give it a try.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 87 guests