Como no recuerdo quien me lo preguntó, no se si obtuvo buenos resultados.....
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
Lo cierto es que ahora soy yo el que necesita totalizar una columna de un browse en el footer (en el browse de HDC) y no doy con la solución.
![Embarassed :oops:](./images/smilies/icon_redface.gif)
![Image](http://img27.imageshack.us/img27/8749/dibujoinud.th.png)
este es un pequeño ejemplo que resume el código que uso:
- Code: Select all Expand view
#include "Fivewin.ch"
#include "FiveWin.ch"
#include "WColors.ch"
external dbfcdx, ordkeyno, ordkeycount, ordkeygoto
#define HA_LEFT 0
#define HA_RIGHT 1
#define HA_CENTER 2
#define VA_TOP 4
#define VA_BOTTOM 8
#define VA_CENTER 32
//----------------------------------------------------------------------------//
function Main()
local oWnd, oLbx
local cKey:= "Upper(Nombre)", oItem
local cDefaultMsg:= "(C) 1994-2002, CeSoTech PC Solutions"
local oFont, oSay
SET DEFAULT TO ".\data"
REQUEST DBFCDX
RddSetDefault("dbfcdx")
DEFINE FONT oFont NAME GetSysFont() SIZE 0,-10 BOLD
use clientes
index on &cKey to clientes
DEFINE DIALOG oWnd FROM 0,0 TO 33,47 + 25 ;
TITLE "Y el footer?" ;
@.2,.2 LISTBOX oLbx FIELDS clientes->nombre , ;
clientes->Telefono, ;
Str(clientes->edad,2) ;
OF oWnd SIZE 280,210 ;
HEADERS "Apellido y Nombres",;
"Telefono", ;
"Edad" ;
SIZES 250,50,50
oLbx:lAdjLastCol := .F.
oLbx:bSeek := {|| oLbx:DbfSeek(.T.) }
oLbx:nLineHeight:= 25
oLbx:lDrawFooters:=.t.
oLbx:aFooters:={ "Total:", " ", {|| TotEdad() } }
ACTIVATE DIALOG oWnd CENTERED
RELEASE FONT oFont
return nil
//----------------------------------------------------------------------------//
Function GetSysFont() ; return "MS Sans Serif"
//----------------------------------------------------------------------------//
FUNCTION TotEdad()
LOCAL ntot:=0
DbEval( {|| ntot+=CLIENTES->Edad } )
RETURN Transform( ntot, "999,999" )
El Exe y el Prg lo encuentran en:
http://www.box.net/shared/gc06xk59ad
Aceptaré agradecido cualquier ayuda que puedan brindarme para alcanzar mi objetivo.
Gracias desde Ya.