Search record from tab

Post Reply
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Search record from tab

Post by Silvio.Falconi »

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
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Search record from tab

Post by nageswaragunupudi »

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
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: Search record from tab

Post by Silvio.Falconi »

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: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: Search record from tab

Post by Silvio.Falconi »

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: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: Search record from tab

Post by Silvio.Falconi »

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
James Bott
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Search record from tab

Post by James Bott »

User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: Search record from tab

Post by Silvio.Falconi »

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
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Search record from tab

Post by ukoenig »

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
James Bott
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Search record from tab

Post by James Bott »

Silvio,

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

James
Post Reply