xbrowse and arrays
Posted: Fri Mar 18, 2011 4:20 am
Hi All
I am trying to use one browse to display different arrays - which have different headers ,column sizes etc
here is how I am setting up the browse
There is an error on this
oLbx:aCols[j]:cHeader := aTitle[i,j]
Error BASE/1005 Class: 'NIL' has no property: CHEADER
Can anyone tell me how to achieve mutliple array's being displayed using the one browse.
Thanks
Colin
I am trying to use one browse to display different arrays - which have different headers ,column sizes etc
here is how I am setting up the browse
Code: Select all
oLbx := TXBrowse():New(oDlg)
oLbx:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oLbx:nColDividerStyle := LINESTYLE_BLACK
oLbx:nRowDividerStyle := LINESTYLE_BLACK
oLbx:lColDividerComplete := TRUE
oLbx:lFastEdit := TRUE
oLbx:nDatalines := 1
oLbx:nRowHeight := 24
oLbx:SetArray(aData)
oLbx:lHScroll := FALSE
oLbx:nStretchCol := STRETCHCOL_LAST
oLbx:bClrStd := { || {CBRWTEXT,CBRWBACK} }
oLbx:bClrSel:= { || {CBRWTEXT,CBRWBACK} }
oLbx:lFooter := TRUE
for i := 1 to len(aTitle)
for j := 1 to len(aTitle[i])
oLbx:aCols[j]:cHeader := aTitle[i,j]
oLbx:aCols[j]:nWidth := aSizes[i,j]
oLbx:aCols[j]:cEditPicture := aPicture[i,j]
next
next
oLbx:CreateFromResource(Brw)
// This function tries resetting the browse
static function lfSetArrays(nSelect,aTitle,aSizes,aPicture,oLbx)
local i := 0,j := 0
asize(aTitle,0)
asize(aSizes,0)
asize(aPicture,0)
asize(oLbx:aCols,0)
if nSelect == 1 .or. nSelect == 2 .or. nSelect == 3
aadd(aTitle,{'Job No.','Job Date','Description','Comp. Date','Contact','Order No.'})
aadd(aSizes,{ 55 , 70 , 500 , 70 , 110 , 100 })
aadd(aPicture,{'@!' ,'99/99/9999','@','99/99/9999','@','@!'})
//aadd(aData,{" ",dtoc(date())," ",dtoc(date())," "," "})
endif
if nSelect == 4
asize(oLbx:aCols,7)
aadd(aTitle,{'Invoice','Date','Sub Total','GST','Total','Paid','Balance'})
aadd(aSizes,{ 70 , 70 , 100 , 100 , 100 , 100 , 100 })
aadd(aPicture,{'@!' ,'99/99/9999','9999999.99','9999999.99','9999999.99','9999999.99','9999999.99'})
endif
for i := 1 to len(aTitle)
for j := 1 to len(aTitle[i])
oLbx:aCols[j]:cHeader := aTitle[i,j]
oLbx:aCols[j]:nWidth := aSizes[i,j]
oLbx:aCols[j]:cEditPicture := aPicture[i,j]
next
next
return(nil)
oLbx:aCols[j]:cHeader := aTitle[i,j]
Error BASE/1005 Class: 'NIL' has no property: CHEADER
Can anyone tell me how to achieve mutliple array's being displayed using the one browse.
Thanks
Colin