Dear Nages,
I explain you
I made this test :
On this test I open clienti.dbf and set array for the field I wish to show
I need to have this arrays (aCampi,aNomi,aSizes) to create the xbrowse Main
Function test()
aCampi := { "CODCF", "RAGSOC", "RAGSOC1", "INDIR" }
aNomi:= {"Codice","Ragione Sociale","Ragione Sociale2","Indirizzo Legale"}
aSizes:= {50,250 ,200,100 }
USE CLIENTI ALIAS CLIENTI NEW
LookUp("Clienti",aCampi,aNomi,aSizes,35.7,105,"Anagrafica clienti")
RETURN NIL
ON lookup function there is a xbrowse and a buttonbar
@ 15.6, 0 XBROWSE oBrw OF oDlgLook SIZE -1,-20 PIXEL ;
DATASOURCE cdbf ;
COLUMNS aCampi HEADERS aNomi COLSIZES aSizes
as you can see omn this picture
When I click a button on Button Bar I call a function . this function read the xbrowse columns to create an array ( aarray) and then I cal the Ut_BrwColVert( aArray ) function
But I see only the fields and not the values
Function testsilvio(cDbf, oBrowse)
LOCAL nLen := Len( oBrowse:aCols )
LOCAL aHeader [ nLen ]
LOCAL aShow [ nlen ]
LOCAL aArray [ nLen ]
FOR n := 1 TO nLen
aHeader [ n ] := oBrowse:aCols[ n ]:cHeader
aShow [ n ] := oBrowse:aCols[ n ]:value
aArray [ n ] := {aHeader[n],aShow[n]}
NEXT
Ut_BrwColVert( aArray )
RETUR NIL
function Ut_BrwColVert( aCols )
local oDlg, oBrw, cAlias
cAlias := Alias()
DEFINE DIALOG oDlg SIZE 300,200 PIXEL TITLE cAlias
@ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
DATASOURCE aCols ;
COLUMNS 1, { || ( cAlias )->&( oBrw:aRow[ 2 ] ) } ;
HEADERS "ColumnName", "ColumnValue" ;
CELL LINES NOBORDER
WITH OBJECT oBrw
:nStretchCol := 2
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED ON INIT ( oBrw:SetFocus(), .f. )
return nil