filtering using set scope..pls help
Posted: Thu Apr 13, 2006 5:03 pm
I need to adjust the program below to be used with set scope instead of set filter .
Code: Select all
STATIC FUNCTION mete( oWnd )
*--------------------------
local oChild, oBrw
local nFor
local bFilter := ""
local cFilter := ""
local x := ""
REQUEST ADS
rddRegister( "ADS", 1 )
rddsetdefault( "ADS" )
AdsSetDeleted(.T.)
SET SERVER LOCAL
SET FILETYPE TO CDX
select 4
USE METE
x := "'9855564'"
cFilter := "me_mc_serl = "+ x
bFilter = "{||"+cFilter+"}"
DBSETFILTER(bFilter,cFilter)
DBGOTOP()
DEFINE WINDOW oChild FROM 4, 4 TO 25, 75 ;
TITLE "Meter Works"
oBrw := TXBrowse():New( oChild )
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:nRowDividerStyle := LINESTYLE_BLACK
oBrw:lColDividerComplete := .t.
oBrw:nHeaderLines := 1
oBrw:nFooterLines := 1
oBrw:nDataLines := 2
oBrw:lFooter := .t.
oBrw:SetRDD()
for nFor := 1 to Fcount()
if nFor=20
oBrw:aCols[ nFor ]:cHeader := FieldName( nFor )
oBrw:aCols[ nFor ]:cFooter := alltrim(STR(TOTALEM2(),12,0))
loop
endif
oBrw:aCols[ nFor ]:cHeader := FieldName( nFor )
oBrw:aCols[ nFor ]:cFooter := FieldName( nFor )
next
oBrw:CreateFromCode()
oChild:oClient := oBrw
ACTIVATE WINDOW oChild MAXIMIZED ON INIT oBrw:SetFocus()
RETURN NIL