That first record is deifferent from my filter condition . I am using go top after set filter and I do not know why I can see different record from my filter scope .
- Code: Select all Expand view
STATIC FUNCTION mete( oWnd )
*--------------------------
local oChild, oBrw
Local oDlgn, oDbfc, oBrwc
local nRecNo := RecNo()
local new_rec := 0
local oGet
local i:=0
local nFor
local bFilter := ""
local cFilter := ""
local x := ""
REQUEST ADS
rddRegister( "ADS", 1 )
rddsetdefault( "ADS" )
AdsSetDeleted(.T.)
SET SERVER LOCAL
SET FILETYPE TO CDX
x := "'9855564'"
cFilter := "me_mc_serl = "+ x
bFilter = "{||"+cFilter+"}"
SELECT 4
use mete
SET index TO mete2
DBSETFILTER(&bFilter,cFilter)
4->(DBGOTOP())
DEFINE DIALOG oDlgn FROM 1,1 TO 50,140 TITLE "Dialog Meter Works"
oBrw := TXBrowse():New( oDlgn )
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:nRowDividerStyle := LINESTYLE_BLACK
oBrw:lColDividerComplete := .t.
oBrw:nHeaderLines := 1
oBrw:nFooterLines := 1
oBrw:nDataLines := 1
oBrw:lFooter := .t.
oBrw:SetRDD()
SELECT 4
use mete
SET index TO mete2
DBSETFILTER(&bFilter,cFilter)
4->(DBGOTOP())
oBrw:Refresh(.t.)
for nFor := 1 to Fcount()
*if (nFor<16)
* loop
*endif
if nFor=21
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
@ 18, 1 BUTTON "&New" OF oDlgn SIZE 40, 12 ACTION addmeter( oLbx, .t. )
@ 18, 8 BUTTON "&Modify" OF oDlgn SIZE 40, 12 //ACTION Editmach( oLbx, .f. )
@ 18, 15 BUTTON "&Delete" OF oDlgn SIZE 40, 12 //ACTION Delrecord( oLbx )
@ 18, 22 BUTTON "&Search" OF oDlgn SIZE 40, 12 //ACTION Seekmach( oLbx )
@ 18, 29 BUTTON "&Print" OF oDlgn ;
SIZE 40, 12;
ACTION oBrw:Report( "Machines Report", .t. ) ; // .t. --> wants preview
@ 18, 36 BUTTON "&Exit" OF oDlgn ACTION oDlgn:End() SIZE 40, 12
@ 19, 1 BUTTON "&Order" OF oDlgn SIZE 40, 12 //ACTION ordermach(oLbx)
@ 19, 8 BUTTON "&Filter" OF oDlgn SIZE 40, 12 //ACTION metefilter(oLbx)
@ 19, 15 BUTTON "&Unfilter" OF oDlgn SIZE 40, 12 //ACTION filtermachNotOk(oLbx)
oBrw:CreateFromCode()
return nil