XBrowse Sample

XBrowse Sample

Postby ryugarai27 » Fri Mar 20, 2009 2:30 am

Hi FiveWin Experts!

I'm new to Xbrowse and I want to to create 2 xbrowses with reference to different database respectively.. I have used DBFilter but the browses crashes the display after each method call to DelRepos(). I wonder if somebody could send me a sample working program with the situation below:

First browse have records of employee indexed by lastname
Second browse contains transactions of employees from the first xBrowse also indexed by lastname. So that each time the record pointer from first XBrowse moves, the 2nd
Xbrowse should only display the transactions made by that employee on the first xbrowse, and not all the transactions of all employees.

This is my email address : rblatoza@yahoo.com

Regards,
ryugarai
User avatar
ryugarai27
 
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines

Re: XBrowse Sample

Postby Richard Chidiak » Fri Mar 20, 2009 5:17 am

Ryugarai

There is a bug in the actual version of xbrowse concerning filtered databases

2 ways to fix it :

1. Make the variables contained in the filter expression private not local so they remain visible to xbrowse
2. Change your copy of xbrowse.prg in the delrepos method and comment the filter section this way

Code: Select all  Expand view

METHOD DelRepos() CLASS TXBrowse

   local lRepos := .f.
   local cFilter, bFilter

   if ::nDataType == DATATYPE_RDD
      if ::nLen > 0
         if Set( _SET_DELETED ) .and. ( ::cAlias )->( Deleted() )
            ( ::cAlias )->( dbSkip( 1 ) )
            if ( ::cAlias )->( eof() )
               ( ::cAlias )->( DbGoBottom() )
            endif
            lRepos := .t.
         /*
         elseif ! Empty( cFilter := ( ::cAlias )->( dbFilter() ) )
            bFilter  := &( "{ || " + cFilter + " }" )
            if ! ( ::cAlias )->( Eval( bFilter ) )
               ( ::cAlias )->( dbSkip( 1 ) )
               if ( ::cAlias )->( eof() )
                  ( ::cAlias )->( DbGoBottom() )
               endif
               lRepos := .t.
            endif
         */

         endif
      endif
   endif

return lRepos

 


HTH

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: XBrowse Sample

Postby ryugarai27 » Fri Mar 20, 2009 9:14 am

Hi Richard!

Thanks for a helping hand.. I'll try and inform you of the results.

ryugarai
User avatar
ryugarai27
 
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines

Re: XBrowse Sample

Postby Silvio » Fri Mar 20, 2009 9:38 am

RIchard ...i use dbsetfilter on Xbrowse and I not have problem ....
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: XBrowse Sample

Postby Richard Chidiak » Fri Mar 20, 2009 11:47 am

Silvio

If your filetered expression is to a constant , number or something like this or a public variable, no problem

if you filter to a local variable you get the error as the variable is not visible to xbrowse

Hth

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: XBrowse Sample

Postby ryugarai27 » Sat Mar 21, 2009 2:41 am

Hi Richard,

The filter now works fine, but an error in DelRepos encountered when pressing the Alt key or when resizing columns with mouse.:

Error description: Error BASE/1003 Variable does not exist: CALIAS_PAYDB

Stack Calls
===========
Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE:DELREPOS(0)
Called from: => EVAL(0)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DELREPOS(0)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:REFRESH(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(0)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(0)


any idea?

Regards,

ryugarai
User avatar
ryugarai27
 
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines

Re: XBrowse Sample

Postby ryugarai27 » Sat Mar 21, 2009 3:00 am

Hi Richard,

This is my declaration of DBSetFilter for the second xBrowse:

DBSetFilter( {|| (cAlias_PAYDB)->PONUM == (cAlias_TRANSDB)->PONUM }, '(cAlias_PAYDB)->PONUM == (cAlias_TRANSDB)->PONUM' )



this is the call from the 1st browse, so that everytime the record pointer on the 1st xbrowse moves, the 2nd xbrowse should be refreshed to display only the desired data:

:bChange := {|| (cAlias_PAYDB)->(DBGoTop()), oXbrow:Refresh( TRUE ), oBrowDlg:Update() }

Regards,

ryugarai
User avatar
ryugarai27
 
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines

Re: XBrowse Sample

Postby Richard Chidiak » Sat Mar 21, 2009 5:06 am

Hi Ryugarai,

Please check that you have declared the alias

oXbrow:cAlias := cAlias_PAYDB

Regards,

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 79 guests