filtering using set scope..pls help

Post Reply
Ehab Samir Aziz
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

filtering using set scope..pls help

Post 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
Frank Demont
Posts: 142
Joined: Sun Oct 09, 2005 10:59 am

Post by Frank Demont »

cFilter := "me_mc_serl = "+ x

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

DBSETFILTER(bFilter,cFilter)

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


Frank
Ehab Samir Aziz
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Post 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 ?
R.F.
Posts: 840
Joined: Thu Oct 13, 2005 7:05 pm

Post by R.F. »

DBSETFILTER (&bFilter,cFilter)..... you forgot the "&" in the macro expression
Saludos
R.F.
Post Reply