Filter doubt in xbrowse

Post Reply
Wanderson
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Filter doubt in xbrowse

Post 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!
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Filter doubt in xbrowse

Post 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
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.
Wanderson
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: Filter doubt in xbrowse

Post 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!
Post Reply