Hi All
I have a small problem with footer calculations with xbrowse - I have created a sample program and test.dbf - how do I upload the files
for Mr Rao to check.
Cheers
Colin
#include "fivewin.ch"
#include "xbrowse.ch"
REQUEST DBFCDX
function Main()
local oWnd, oBrw
fwNumFormat( 'A', .t., .f. )
USE COLIN NEW SHARED VIA 'DBFCDX'
DEFINE WINDOW oWnd
SET MESSAGE OF oWnd TO '' 2007
@ 0,0 XBROWSE oBrw OF oWnd ALIAS Alias() ;
COLUMNS "Code", "DESC", "Qty", "Cost", "Charge" ;
HEADERS , "Description" ;
PICTURES "@!" ;
CELL LINES FOOTERS FASTEDIT
WITH OBJECT oBrw
:nEditTypes := EDIT_GET
:nStretchCol := STRETCHCOL_WIDEST
:lHScroll := .f.
END
WITH OBJECT oBrw:Qty
:nFooterType := AGGR_SUM
:bOnChange := { || (oBrw:cAlias)->Charge := (oBrw:cAlias)->Qty * (oBrw:cAlias)->Cost, ;
oBrw:MakeTotals( oBrw:Charge ), oBrw:RefreshFooters() }
END
WITH OBJECT oBrw:Cost
:nFooterType := AGGR_SUM
:bOnChange := { || (oBrw:cAlias)->Charge := (oBrw:cAlias)->Qty * (oBrw:cAlias)->Cost, ;
oBrw:MakeTotals( oBrw:Charge ), oBrw:RefreshFooters() }
END
WITH OBJECT oBrw:Charge
:nFooterType := AGGR_SUM
:bOnChange := { || (oBrw:cAlias)->Cost := (oBrw:cAlias)->Charge / (oBrw:cAlias)->Qty, ;
oBrw:MakeTotals( oBrw:Cost ), oBrw:RefreshFooters() }
:bEditWhen := { || (oBrw:cAlias)->Qty > 0 }
END
oBrw:MakeTotals()
oBrw:CreateFromCode()
oWnd:oClient := oBrw
ACTIVATE WINDOW oWnd
return 0
reinaldocrespo wrote:Hi.
I have a problem with money fields where the totals on footer are shown with 4 decimal places instead of 2. How can I deal with that problem?
Reinaldo.
nageswaragunupudi wrote:Are the totals shown with 4 decimals by xbrowse, where as you want to show with 2 decimal places?
Can I see a sample code?
#include "fivewin.ch"
#include "xbrowse.ch"
REQUEST DBFCDX
function Main()
local oWnd, oBrw
fwNumFormat( 'A', .t., .f. )
USE COLIN NEW SHARED VIA 'DBFCDX'
DEFINE WINDOW oWnd
SET MESSAGE OF oWnd TO '' 2007
@ 0,0 XBROWSE oBrw OF oWnd ALIAS Alias() ;
COLUMNS "Code", "DESC", "Qty", "Cost", "Charge" ;
HEADERS , "Description" ;
PICTURES "@!" ;
CELL LINES FOOTERS FASTEDIT
WITH OBJECT oBrw
:nEditTypes := EDIT_GET
:nStretchCol := STRETCHCOL_WIDEST
:lHScroll := .f.
END
WITH OBJECT oBrw:Qty
:nFooterType := AGGR_SUM
:bOnChange := { || oBrw:Charge:PostEdit( oBrw:Qty:Value * oBrw:Cost:Value ) }
END
WITH OBJECT oBrw:Cost
:nFooterType := AGGR_SUM
:bOnChange := { || oBrw:Charge:PostEdit( oBrw:Qty:Value * oBrw:Cost:Value ) }
END
WITH OBJECT oBrw:Charge
:nFooterType := AGGR_SUM
:bEditWhen := { || (oBrw:cAlias)->Qty > 0 }
:bOnChange := { || oBrw:Cost:PostEdit( oBrw:Charge:Value / oBrw:Qty:Value ) }
END
oBrw:MakeTotals()
oBrw:CreateFromCode()
oWnd:oClient := oBrw
ACTIVATE WINDOW oWnd
return 0
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 41 guests