- Code: Select all Expand view
STATIC FUNCTION listmete( oWnd )
*--------------------------
local oDlg, oCol
local nTotal:=0
local oBrw
local nfor,cFilter:="",bFilter:=""
local y
local V_me_mc_serl:= space(7)
REQUEST ADS
rddRegister( "ADS", 1 )
rddsetdefault( "ADS" )
AdsSetDeleted(.T.)
SET SERVER LOCAL
SET FILETYPE TO CDX
select 4
use mete
index on mete->ME_mc_serl to mete
index on str(mete->year) + str(mete->month) to mete1
index on mete->me_date to mete2
set index to mete
if MsgGet( "Serial Machine", "Enter Serial Machine", @V_me_mc_serl,;
"..\lupa.bmp" )
select 3
use mach
set index to mach5
*MSGINFO(IndexKey())
if ! DbSeek( (V_me_mc_serl ))
MsgAlert( "I don't find that serial" )
endif
endif
y := "'"+padr(V_me_mc_serl,7)+"'"
cFilter := "me_mc_serl = "+ y
bFilter = "{||"+cFilter+"}"
select 4
use mete
DBSETFILTER(&bFilter,cFilter)
mete->(DBGOTOP())
DEFINE DIALOG oDlg of oWnd FROM 0,0 TO 45,128 TITLE "Meter reads browse "
oBrw := TXBrowse():New( oDlg )
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()
oBrw:CreateFromCode()
oBrw:nTop = 0
oBrw:nLeft = 0
oBrw:nWidth = 1000
oBrw:nHeight =600
for nFor := 1 to Fcount()
*oBrw:aCols[ nFor ]:cFooter := alltrim(STR(TOTALEM2(V_me_mc_serl),12,0))
if nFor=27
oBrw:aCols[ nFor ]:cHeader := FieldName( nFor )
oBrw:aCols[ nFor ]:cFooter := alltrim(STR(TOTALEM2(),12,2))
loop
endif
*oBrw:aCols[ nFor ]:cHeader := FieldName( nFor )
*oBrw:aCols[ nFor ]:cFooter := FieldName( nFor )
next
oBrw:Refresh(.t.) // Repaint the ListBox
ACTIVATE DIALOG oDlg ON INIT (oBrw:SetSize( 1000, 600 ),BuildButtons( oDlg ),oBrw:gotop(),oBrw:Refresh(.t.),oDlg:Refresh(.t.))
RETURN NIL