FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Filter doubt in xbrowse
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Filter doubt in xbrowse
Posted: Mon Mar 12, 2018 07:39 PM

Hi,

I use xbrowse filter like this:

oCheque:OrdScope(0,Nil)
oCheque:OrdScope(1,Nil)
oBrwCh:Refresh()
oCheque:SetOrder("NCHEQUE")
oCheque:OrdScope(0,Rec1)
oCheque:OrdScope(1,Rec2)
oBrwCh:Refresh()

When I try to clear filter one empty line apear in xbrowse, if i click inside a browse the line disapear, why i do wrong?

oCheque:OrdScope(0,Nil)
oCheque:OrdScope(1,Nil)
xSetFocus(oBrwCh)
oBrwCh:Refresh()

Thanks!

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Filter doubt in xbrowse
Posted: Mon Mar 12, 2018 08:31 PM
A sample that works fine for me during the years

1. Customer browser
2. Services of a customer ( shows only the customer selected from DBF 1 )

// get the name from customer.dbf

WITH OBJECT oBrw1 // Customer
:bChange := { || SET_SCOPE(cMonth) ; // set the customer-filter in browser 2 services
oBrw2:Refresh()} // refresh services DBF 2
END

oBrw2 shows services of the selected customer

// ------- called on customer-change in DBF 1 -------------------------

STATIC FUNCTION SET_SCOPE(cMonth) // the selected service-DBF ( Jan - Dec )
LOCAL cNName := UPPER((CUSTOMER)->NAME1) + UPPER((CUSTOMER)->NAME) // the cusomer name from DBF 1 to filter DBF 2

DBSELECTAREA( cMonth ) // DBF 2
(cMonth)->( ORDSCOPE( 0, NIL ) )
(cMonth)->( ORDSCOPE( 1, NIL ) )
(cMonth)->( ORDSCOPE(0, cNName ) ) // name of the customer from DBF 1
(cMonth)->( ORDSCOPE(1, cNName ) )

RETURN NIL

regards
Uwe :-)
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.
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Re: Filter doubt in xbrowse
Posted: Mon Mar 19, 2018 11:46 AM
ukoenig wrote:A sample that works fine for me during the years

1. Customer browser
2. Services of a customer ( shows only the customer selected from DBF 1 )

// get the name from customer.dbf

WITH OBJECT oBrw1 // Customer
:bChange := { || SET_SCOPE(cMonth) ; // set the customer-filter in browser 2 services
oBrw2:Refresh()} // refresh services DBF 2
END

oBrw2 shows services of the selected customer

// ------- called on customer-change in DBF 1 -------------------------

STATIC FUNCTION SET_SCOPE(cMonth) // the selected service-DBF ( Jan - Dec )
LOCAL cNName := UPPER((CUSTOMER)->NAME1) + UPPER((CUSTOMER)->NAME) // the cusomer name from DBF 1 to filter DBF 2

DBSELECTAREA( cMonth ) // DBF 2
(cMonth)->( ORDSCOPE( 0, NIL ) )
(cMonth)->( ORDSCOPE( 1, NIL ) )
(cMonth)->( ORDSCOPE(0, cNName ) ) // name of the customer from DBF 1
(cMonth)->( ORDSCOPE(1, cNName ) )

RETURN NIL

regards
Uwe :-)


Thank you!

Continue the discussion