Xbrowse lSeekBar, How to do Set Relation to

Xbrowse lSeekBar, How to do Set Relation to

Postby Jorge_T » Thu May 13, 2021 7:00 pm

I am relating two databases, with the corresponding indexed fields, I use Xbrowse lSeekBar to be able to search.

It allows me to search all the fields in the main table but NOT the related table field.

In the example, I can't search for "State name"

Thanks,

Code: Select all  Expand view

#include "fivewin.ch"
REQUEST DBFCDX
//----------------------------------------------------------------------------//
function Main()

    local oDlg, oBrw  
    *SetGetColorFocus()
   
    FERASE( "STATES.CDX" )
    Use STATES alias "states" NEW exclusive VIA "DBFCDX"
    FW_CdxCreate()
    Set order to TAG CODE
    go top
   
    FERASE( "CUSTOMER.CDX" )
    Use CUSTOMER alias "customer" NEW exclusive VIA "DBFCDX"
    FW_CdxCreate() 
    go top
   
    SET RELATION to field->state INTO states

    Define Dialog oDlg size 1000,600 PIXEL TRUEPIXEL
   
    @ 10,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
        Columns "FIRST","LAST","CITY","STATE","states->name";
        Headers "First","Last","City","State Code","State Name";
        DATASOURCE "customer" ;
        AUTOCOLS AUTOSORT CELL LINES NOBORDER
   
        WITH OBJECT oBrw
            :nMarqueeStyle := MARQSTYLE_HIGHLROW
            :lSeekBar:= .T.
            :lIncrFilter   := .F.      
            :CreateFromCode()
        END

    Activate dialog oDlg centered
return nil
 


[img]
Image
[/img]
Jorge
--------------------------------------------------
Fivewin 18.10 - Harbour - BCC 7 - PellesC
--------------------------------------------------
Jorge_T
 
Posts: 38
Joined: Tue Jan 22, 2019 8:28 am

Re: Xbrowse lSeekBar, How to do Set Relation to

Postby nageswaragunupudi » Fri May 14, 2021 4:20 am

Code: Select all  Expand view
/*
* XBrowse Incremental seek on fields from
* related tables
*
*/


#include "fivewin.ch"

REQUEST DBFCDX

//----------------------------------------------------------------------------//

function Main()

    local oDlg, oBrw

    FERASE( "STATES.CDX" )
    USE STATES ALIAS "STATES" NEW EXCLUSIVE VIA "DBFCDX"
    FW_CdxCreate()
    SET ORDER TO TAG CODE
    GO TOP

    FERASE( "CUSTOMER.CDX" )
    USE CUSTOMER ALIAS "CUSTOMER" NEW EXCLUSIVE VIA "DBFCDX"
    FW_CdxCreate()
    GO TOP

    SET RELATION TO FIELD->STATE INTO STATES
    GO TOP
    INDEX ON UPPER(STATES->NAME) TAG STATENAME TO TEMP TEMPORARY ADDITIVE
    SET ORDER TO TAG FIRST
    GO TOP

    DEFINE DIALOG ODLG SIZE 1000,600 PIXEL TRUEPIXEL

    @ 10,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
        Columns "FIRST","LAST","CITY","STATE","STATES->NAME";
        Headers "First","Last","City","State Code","State Name";
        DATASOURCE "customer" ;
        AUTOSORT CELL LINES NOBORDER  // do not use AUTOCOLS when you specify columns

        WITH OBJECT oBrw
            :nMarqueeStyle := MARQSTYLE_HIGHLROW
            :lSeekBar:= .T.
            :lIncrFilter   := .F.
            WITH OBJECT :aCols[ 5 ]
               :cOrdBag    := "TEMP"
               :cSortOrder := "STATENAME"
            END
            :CreateFromCode()
        END

    ACTIVATE DIALOG oDlg CENTERED

return nil
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 24 guests