Filter doubt in xbrowse

Filter doubt in xbrowse

Postby Wanderson » Mon Mar 12, 2018 7: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!
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: Filter doubt in xbrowse

Postby ukoenig » Mon Mar 12, 2018 8: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 :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: Filter doubt in xbrowse

Postby Wanderson » 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 :D


Thank you!
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 72 guests