Let Xbrowse update selected colums in other dbf
Posted: Wed Sep 16, 2020 8:48 am
I have a master xbrowse (dbf) with many colums
With Xbrowse i select the colums that I want to update in a second database (fieldnames are identical)
For the selecting of colums i use Mr. Rao's function : XbrColselector(oBrw)
Now it would be nice If I could klik a button or so that only the selected colums are updated . (many times the selection can be different)
Always the field 'Code' will be used as seek parameter in the second database.
[/code]
With Xbrowse i select the colums that I want to update in a second database (fieldnames are identical)
For the selecting of colums i use Mr. Rao's function : XbrColselector(oBrw)
Now it would be nice If I could klik a button or so that only the selected colums are updated . (many times the selection can be different)
Always the field 'Code' will be used as seek parameter in the second database.
Code: Select all
function XbrColselector(oBrowse)
local oDlg, oBrw
local aSave := aCopy( oBrowse:aCols )
DEFINE DIALOG oDlg SIZE 300,400 PIXEL TRUEPIXEL
@ 60,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE oBrowse:aCols ;
COLUMNS "lHide", "cHeader" ;
HEADERS "", "Header" ;
COLSIZES 40, 100 ;
CELL LINES NOBORDER
WITH OBJECT oBrw
:nStretchCol := 2
WITH OBJECT :aCols[ 1 ]
:bEditValue := { |x| If( x == nil, !oBrw:aRow:lHide, oBrw:aRow:lHide := !x ) }
:SetCheck( nil, .t. )
:nHeadBmpNo := 2
END
:CreateFromCode()
END
@ 20,180 BTNBMP PROMPT "Close" SIZE 100,30 FLAT PIXEL OF oDlg ACTION oDlg:End()
@ 20,80 BTNBMP PROMPT "ALL" SIZE 100,30 FLAT PIXEL OF oDlg ACTION (AEval( oBrowse:aCols, { |o| o:lHide := .f. } ),oDlg:End() )
ACTIVATE DIALOG oDlg CENTERED
oBrowse:Refresh()
return nil
[code]
function +
local oDlg, oBrw
local aSave := aCopy( oBrowse:aCols )
DEFINE DIALOG oDlg SIZE 300,400 PIXEL TRUEPIXEL
@ 60,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE oBrowse:aCols ;
COLUMNS "lHide", "cHeader" ;
HEADERS "", "Header" ;
COLSIZES 40, 100 ;
CELL LINES NOBORDER
WITH OBJECT oBrw
:nStretchCol := 2
WITH OBJECT :aCols[ 1 ]
:bEditValue := { |x| If( x == nil, !oBrw:aRow:lHide, oBrw:aRow:lHide := !x ) }
:SetCheck( nil, .t. )
:nHeadBmpNo := 2
END
:CreateFromCode()
END
@ 20,180 BTNBMP PROMPT "Close" SIZE 100,30 FLAT PIXEL OF oDlg ACTION oDlg:End()
@ 20,80 BTNBMP PROMPT "ALL" SIZE 100,30 FLAT PIXEL OF oDlg ACTION (AEval( oBrowse:aCols, { |o| o:lHide := .f. } ),oDlg:End() )
ACTIVATE DIALOG oDlg CENTERED
oBrowse:Refresh()
return nil
[/code]