Rao,
Thanks for reply
I use version 13.01 & 13.02 for applications ....higher for testing
I have seen now BUG in the ADD COLUMN command in xbrowse.ch line 196
<.lite.>, <nOrder>, <nAt>, <nBmpElem>, [\{ <aBmp> \}], <.hide.>,, ;
and changed in to
<.lite.>, <nOrder>, <nAt>, <nBmpElem>, [\{ <aBmp> \}], <.hide.>, ;
sugested option
PICTURE { |n| If( n > "99999", "9999999999", "99999" } ;
Produce Syntax error
sugested option
- Code: Select all Expand view RUN
FOOTER { |o,nNew,nOld| TRANSFORM( oCol:nTotal += ( IfNil( nNew, 0 ) - IfNil( nOld, 0 ) ), "999999" )
Make wrong totals
Test this sample
- Code: Select all Expand view RUN
#include "FiveWin.Ch"
#include "XBrowse.Ch"
#define CLR_PLAVO_POSVETLO nRGB( 203, 225, 252 )
#define CLR_PLAVO_POTEMNO nRGB( 125, 165, 224 )
//----------------------------------------------------------------------------//
function Main()
local oDlg, oBrw, oCol, oBtnReset
aSumar := {{" ",0,0,0}}
DEFINE DIALOG oDlg SIZE 550,250 TITLE "Test"
@ 5, 5 XBROWSE oBrw OF oDlg ;
SIZE 200,100 PIXEL ;
ARRAY aSumar LINES FASTEDIT CELL FOOTERS
ADD oCol TO oBrw DATA ARRAY ELEMENT 1 ;
HEADER "Col1" ;
SIZE 30 ;
PICTURE "XX" ;
EDITABLE
ADD oCol TO oBrw DATA ARRAY ELEMENT 2 ;
HEADER "Col2" ;
SIZE 70 ;
PICTURE "99999" ;
; // PICTURE { |n| If( n > "99999", "9999999999", "99999" } ;
EDITABLE TOTAL 0 ;
FOOTER { |o,nNew,nOld| TRANSFORM( oCol:nTotal += ( IfNil( nNew, 0 ) - IfNil( nOld, 0 ) ), "99999999" ) }
; // FOOTER { |o,nNew,nOld| TRANSFORM( o:nTotal += ( IfNil( nNew, 0 ) - IfNil( nOld, 0 ) ), "99999999" ) }
; // FOOTER { |oCol,nNew,nOld| TRANSFORM( oCol:nTotal += ( IfNil( nNew, 0 ) - IfNil( nOld, 0 ) ), "99999999" ) }
ADD oCol TO oBrw DATA ARRAY ELEMENT 3 ;
HEADER "Col3" ;
SIZE 100 ;
PICTURE "9999999999" ;
EDITABLE TOTAL 0
ADD oCol TO oBrw DATA ARRAY ELEMENT 4 ;
HEADER "Col4" ;
SIZE 100 ;
PICTURE "9999999999" ;
EDITABLE TOTAL 0
oBrw:l2007 := .t. // 2007 Style
oBrw:lAllowRowSizing := .f.
AEval( oBrw:aCols, { |o| o:lAllowSizing := .f. } )
oBrw:lAllowColSwapping := .f.
oBrw:lAllowColHiding := .f.
oBrw:lColDividerComplete := .f.
oBrw:nSizePen := 1
oBrw:nColorPen := CLR_PLAVO_POTEMNO
oBrw:MakeTotals()
oBrw:CreateFromCode()
@ 5,220 BUTTON oBtnReset PROMPT "ResetArray" SIZE 50,12 PIXEL ;
ACTION ResetArray( oBrw )
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
//----------------------------------------------------------------------------//
FUNCTION ResetArray( oBrw )
ASIZE( aSumar, 0 )
AADD( aSumar, {"01",10,100,1000} )
AADD( aSumar, {"02",20,200,2000} )
oBrw:Refresh()
oBrw:MakeTotals()
RETURN NIL
Using line 34 or 35 going good
; // FOOTER { |o,nNew,nOld| TRANSFORM( o:nTotal += ( IfNil( nNew, 0 ) - IfNil( nOld, 0 ) ), "99999999" ) }
; // FOOTER { |oCol,nNew,nOld| TRANSFORM( oCol:nTotal += ( IfNil( nNew, 0 ) - IfNil( nOld, 0 ) ), "99999999" ) }
However
i think Carlos option
oBrw:oCols[01]:cFooterPicture := "@999,999,999.99"
need to be part of xBrowse
(tested working good)
Best rehards
And thanks for the time