Page 1 of 1

filtering using set scope..pls help

Posted: Thu Apr 13, 2006 5:03 pm
by Ehab Samir Aziz
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

Posted: Mon Apr 17, 2006 9:50 am
by Frank Demont
cFilter := "me_mc_serl = "+ x

bFilter = "{||"+cFilter+"}"

DBSETFILTER(bFilter,cFilter)

bFilter isn't a codeblock , macro expansion ?????????????


Frank

Posted: Mon Apr 17, 2006 6:23 pm
by Ehab Samir Aziz
believe me was macro also filter does not work with RDD server . pls if you know the syntax of set scope tell me ?

Posted: Mon Apr 17, 2006 6:24 pm
by R.F.
DBSETFILTER (&bFilter,cFilter)..... you forgot the "&" in the macro expression