Page 1 of 1

Filter doubt in xbrowse

Posted: Mon Mar 12, 2018 7:39 pm
by Wanderson
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!

Re: Filter doubt in xbrowse

Posted: Mon Mar 12, 2018 8:31 pm
by ukoenig
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 :D

Re: Filter doubt in xbrowse

Posted: Mon Mar 19, 2018 11:46 am
by Wanderson
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 :D
Thank you!