FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xbrowse maketotals fwh 10.1
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
xbrowse maketotals fwh 10.1
Posted: Thu Mar 25, 2010 10:21 AM
Hello

I can't have footers drawn on a browse where i need to total just the last column (6)

I am surely missing something,

Thanks for the help

Code (fw): Select all Collapse
@ 155,5 XBROWSE oBrw OF ownd ;
      SIZE ownd:nwidth - 10,ownd:nHeight - 270 PIXEL ;
      FIELDS DET->PID,DET01(OBRW),DET->LUNITE,DET->NUNITES,DET->PUHT,DET->VALHT ;
      PICTURES nil, nil ,nil, "@Z 999 999.999", "@Z 999 999 999 999.99","@Z 999 999 999 999.99" ;
      HEADERS "Code", "Désignation","  ","Quantité","Px Unitaire","Px Total";
      FIELDSIZES 80,400,50,100,100,100 ;
      FONT AFONT ;
      FOOTERS  ;
      ALIAS "DET"

oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw:lColDividerComplete := .t.
oBrw:nColDividerStyle := LINESTYLE_LIGHTGRAY
oBrw:nRowDividerStyle := LINESTYLE_LIGHTGRAY
//oBrw:nStretchCol := STRETCHCOL_LAST

obrw:obrush  := obrush1
OBRW:bClrStd := {|| { CLR_BLUE, CLR_WHITE } }

oBrw:aCols[6]:lTotal := .t.
oBrw:MakeTotals()
oBrw:CreateFromCODE()

OBRW:SETFOCUS()
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xbrowse maketotals fwh 10.1
Posted: Thu Mar 25, 2010 10:42 AM

oBrw:aCols[6]:lTotal := .t.
oBrw:aCols[6]:nTotal := 0 // this line also is required

oBrw:MakeTotals()

Regards



G. N. Rao.

Hyderabad, India
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: xbrowse maketotals fwh 10.1
Posted: Mon Mar 29, 2010 05:56 PM
Code (fw): Select all Collapse
oBrw:aCols[6]:nTotal := 0


It seems like that should be part of the TXBrowse code.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xbrowse maketotals fwh 10.1
Posted: Tue Mar 30, 2010 01:14 AM
James Bott wrote:
Code (fw): Select all Collapse
oBrw:aCols[6]:nTotal := 0


It seems like that should be part of the TXBrowse code.

James


MakeTotals() method totals only those columns where oCol:nTotal is numeric and displays oCol:nTotal in the footer using the oCol:cEditPicture.

oCol:lTotal is used to total in export to Excel and in Report method.
Regards



G. N. Rao.

Hyderabad, India
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: xbrowse maketotals fwh 10.1
Posted: Tue Mar 30, 2010 01:30 AM

Rao,

Thanks for clarifying that.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xbrowse maketotals fwh 10.1
Posted: Tue Mar 30, 2010 01:45 AM

Additional Info:
From version 10.2 onwards it is enough to assign
oCol:nFooterType := AGGR_TOTAL // or AGGR_SUM.
It is not necessary to assign values for oCol:lTotal and oCol:nTotal.

Other available options are :
oCol:nFooterType := AGGR_MAX or AGGR_MIN or AGGR_COUNT or AGGR_AVERAGE/AGGR_AVG or AGGR_STD/AGGR_STDEV or AGGR_STDEVP.

XBrowses computations are compatible with Excel's functions with the same names.

In all these cases, like in all earlier versions, if the value of the column is edited inline, the footer's value is automatically updated with the change and footer refreshed.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion